Jump to content

pstools copy from remote computer to local computer


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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!

Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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 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.
Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...