Page 1 of 1 1
Topic Options
#20868 - 2002-04-30 03:01 AM RedirectOutput
karabin Offline
Fresh Scripter

Registered: 2002-04-25
Posts: 5
Loc: Doylestown, PA
ReDirectOutput("\\papasmurf\temp$\@WKSTA.log")
Run c:\cmdinfo\cmdinfo.exe

above i am trying to output the results of the
program to a file.

but, the output is still going to the screen

any ideas?
_________________________
Jason Karabin jason@karbin.org If it ain't broke, always try to fix it

Top
#20869 - 2002-04-30 03:18 AM Re: RedirectOutput
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
The "RUN" command spawns a new process. Try using the "SHELL" command instead of the "RUN" command.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#20870 - 2002-04-30 04:26 AM Re: RedirectOutput
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
karabin,

I think you are looking for this...
code:
ReDirectOutput("\\papasmurf\temp$\@WKSTA.log")
SHELL "%COMSPEC% /C c:\cmdinfo\cmdinfo.exe > Nul"

!! Be cautious with the NUL as a common mistake is to do NULL and it creates a file where the script was executed.

Or to a file..
code:
SHELL "%COMSPEC% /C c:\cmdinfo\cmdinfo.exe > \\papasmurf\temp$\@WKSTA.log"

Things to remember about with the Redirects ">"..
  • A single ">" always starts or erases a file.
  • A double ">>" appends to the end of a file.
HTH,
- Kent

[ 30 April 2002, 04:28: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#20871 - 2002-04-30 04:35 AM Re: RedirectOutput
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
While Howard and Kent seem to have this covered, there are a few FAQs you may want to peruse.

(almost) everything you wanted to know about RUN and SHELL

File Input/Output Primer

(mis)use of quotes

p.s. where $ is used within quotes, it should be $$.

[ 30 April 2002, 06:19: Message edited by: LLigetfa ]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#20872 - 2002-04-30 01:29 PM Re: RedirectOutput
karabin Offline
Fresh Scripter

Registered: 2002-04-25
Posts: 5
Loc: Doylestown, PA
Everyone thanks for all the help!

LLigetfa, when you say using $ within quotes are you refering to when i use "\\papasmurf\...\temp$"

should be "\\papasmurf\..\temp$$"
_________________________
Jason Karabin jason@karbin.org If it ain't broke, always try to fix it

Top
#20873 - 2002-04-30 02:58 PM Re: RedirectOutput
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Yes
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.06 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org