ioliver Posted September 23, 2004 Posted September 23, 2004 (edited) Here's my latest: When I run psinfo \\computername > c:\psinfo.txt from a command prompt it works. The command line output from psinfo.exe is redireted to the c:\psinfo.txt file. But, When I run the following: Func PSInfo() FileInstall("c:\psinfo\psinfo.exe", "c:\psinfo.exe") FileInstall("c:\psinfo\pdh.dll", "c:\pdh.dll") RunWait(@ComSpec & " /c " & "psinfo.exe \\" & $host & " > c:\psinfo.txt", "", @SW_HIDE) EndFunc I think it's passing the ">" as part of the computername. In other words: psinfo \\"computername > c:\psinfo.txt" Any ideas on what I should do to pass the command correctly? If you need more information or I didn't explain the problem correctly, please let me know. As always, thanks very much for all your help, Ian Edited September 23, 2004 by ioliver "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
emmanuel Posted September 23, 2004 Posted September 23, 2004 Here's my latest: When I run psinfo \\computername > c:\psinfo.txt from a command prompt it works. The command line output from psinfo.exe is redireted to the c:\psinfo.txt file. But, When I run the following: Func PSInfo() FileInstall("c:\psinfo\psinfo.exe", "c:\psinfo.exe") FileInstall("c:\psinfo\pdh.dll", "c:\pdh.dll") RunWait(@ComSpec & " /c " & "psinfo.exe \\" & $host & " > c:\psinfo.txt", "", @SW_HIDE) EndFunc I think it's passing the ">" as part of the computername. In other words: psinfo \\"computername > c:\psinfo.txt" Any ideas on what I should do to pass the command correctly? If you need more information or I didn't explain the problem correctly, please let me know. As always, thanks very much for all your help, Ian <{POST_SNAPBACK}>I suggest putting this in place of the runwait to test it:msgbox(0,"",@ComSpec & " /c " & "psinfo.exe \\" & $host & " > c:\psinfo.txt") that'll tell you if it's a showing to the runwait as you want it to "I'm not even supposed to be here today!" -Dante (Hicks)
ioliver Posted September 23, 2004 Author Posted September 23, 2004 Thanks emmanuel, I tried that, and it shows up the way that I would enter it at a command line, but it's does not write my text file. Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
CyberSlug Posted September 23, 2004 Posted September 23, 2004 Works for me.... Can the host name contain spaces? You might want to try this: RunWait(@ComSpec & ' /c ' & 'psinfo.exe "\\' & $host & '" > c:\psinfo.txt', '', @SW_HIDE) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
ioliver Posted September 23, 2004 Author Posted September 23, 2004 where is psinfo.exe located? in the script directory? try RunWait(@ComSpec & " /c " & "c:\psinfo\psinfo.exe \\" & $host & " > c:\psinfo.txt", "", @SW_HIDE) <{POST_SNAPBACK}>Larry, I FileInstall() psinfo.exe to c:\, should I still try to run it for c:\psinfo? Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
ioliver Posted September 23, 2004 Author Posted September 23, 2004 Works for me.... Can the host name contain spaces? You might want to try this: RunWait(@ComSpec & ' /c ' & 'psinfo.exe "\\' & $host & '" > c:\psinfo.txt', '', @SW_HIDE) <{POST_SNAPBACK}>I tried doing it your way CyberSlug, My text file is outputted but there is no information inside it... Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
CyberSlug Posted September 23, 2004 Posted September 23, 2004 Workaround: Put the command line in a batch file. RunWait("nameOfBatchFile.bat", "", @SW_HIDE) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
ZeDMIN Posted September 24, 2004 Posted September 24, 2004 This one worked fine here: Func PSInfo() FileInstall("psinfo.exe", "c:\psinfo.exe") FileInstall("pdh.dll", "c:\pdh.dll") RunWait(@ComSpec & ' /c c:\psinfo.exe "\\' & $host & '" > c:\psinfo.txt', 'c:\', @SW_HIDE) EndFunc Please note: PSInfo does not accept "localhost" or "127.0.0.1" as valid hostnames!!! Just in case you were trying to test it on your own computer. Take your real hostname or IP address instead. Greetings, ZeD
ioliver Posted September 24, 2004 Author Posted September 24, 2004 Thanks ZeDMIN, your code works great. Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now