Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I get this script to output to a specified file?

Status
Not open for further replies.

ahoover

Programmer
Feb 4, 2004
20
0
0
US

"psexec \\" & strcomputer & " " & chr(34) & "c:\temp\sav"& chr(34)

I want to run this on multiple PCs and have it drop the text line into a file, one after the other. I can't figure out how to get it to work with a "> log.txt" command. I might be placing it in the wrong spot. Any ideas? Appreciate any help.
 
The command line to run should be something like this:
"cmd /C psexec \\" & strcomputer & " " & chr(34) & "c:\temp\sav" & chr(34) & " >>log.txt"

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
that didn't work...it just displayed '>>log.txt' in the line. I don't want that part displayed, i want it to drop the info before it INTO that file. any more ideas?
 
Can you please post the EXACT code that didn't work ?
 
Maybe I'm explaining this wrong. Okay, it's like this. I want this exact string of text to be RE-displayed in another file. I don't want the results of it displayed in the file. I hope this helps. Thanks PHV, you're getting me on the right track. Here's the string again.

"cmd /C psexec \\" & strcomputer & " " & chr(34) & "c:\temp\sav" & chr(34) & " >>log.txt"

so when I go open log.txt I see in the file a string of text that says, "psexec \\pcname "c:\temp\sav". Is that possible?
 
Something like this ?
cmd="psexec \\" & strcomputer & " " & chr(34) & "c:\temp\sav" & chr(34)
sh.Run "cmd /c echo " & cmd & " >>log.txt"
sh.Run cmd

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hello ahoover,

[1] >>I want this exact string of text to be RE-displayed in another file. I don't want the results of it displayed in the file.

Can you put it even more clearer?

[2] What is it all about c:\temp\sav? What is it?

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top