Billd59 Posted July 6, 2012 Posted July 6, 2012 I want to redirect a batch file from the remote computer I connect throw with Psexec to my local computer? I am a home user. What I am planing to do Is ipconfig on the remoter computer and make a batch file to be save on the local computer. I know on the remote computer you do cmd ipconfig > than than batch file to be saved. for exple iIf the file Is test you would do: config >test.bat
Moderators JLogan3o13 Posted July 6, 2012 Moderators Posted July 6, 2012 Hi, Billd59, welcome to the forum. Unfortunately, your explanation leaves a bit to be desired. If you're looking for a way to do an IPConfig and save it to a batch file (why not text??), so you can then run it on a remote machine with PSExec, you can do something like this: RunWait( @ComSpec & ' /k ipconfig>Test.bat', "", @SW_HIDE ) You would then run the command through PSExec, copying the AutoIt script to the remote machine before executing. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
UEZ Posted July 6, 2012 Posted July 6, 2012 Use WMI to get the IP information from the remote computer. Using PSExec is too complicated here but possible! Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
jdelaney Posted July 6, 2012 Posted July 6, 2012 (edited) this works for me, but you will have to parse the file to get the ip PsExec.exe [url="file://computername"]computername[/url] ipconfig > C:test.txt Runs ipconfig on the remote station, and writes the output locally Edited July 6, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
UEZ Posted July 6, 2012 Posted July 6, 2012 Try this: $source = @IPAddress1 $dest = "hostname" $psexec = "path to psexec.exe " $psexec_param = "" & $dest & " ipconfig /all > " & $source & "c$tempipconfig_" & $dest & ".txt" $pid = RunWait($psexec & $psexec_param, @ScriptDir, @SW_HIDE) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
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