Jump to content
Sign in to follow this  

Remote Gateway or PsExec.exe to txt file

Recommended Posts



The company we have 30 computers running windows 8.1 and three lines ADSL, what I want is to change on occasion the ADSL line. After many hours searching on autoitscript.com/forum and on Google, I came to the solution of PsExec.exe together with netsh.

Eventually the command that I use and it works is as follows:

$sParameter = "netsh interface ip set address ethernet static"
$sComputerName = "PCE04 "
Run("C:\PSTools\PsExec.exe \\" & $sCompureName &$sParameter)

The problem is that I want to see the gate (= ADSL line) before the change.

Other so many hours searching to arrive at a method to store ipconfig in a txt file.
While locally works fine, when I want to run the
ipconfig for the client does not work!
If you do the command
PsExec.exe \\[ComputerName] ipconfig > C:\Pcip.ini copying the command prompt of windows 8.1 works perfectly, just to embed in autoit not create the file.

$sComputerName = "PCE04 "

$res = RunWait(@ComSpec & "PsExec.exe \\" & $sComputerName & "ipconfig > C:\PcIP.ini", "", @SW_HIDE)
If $res = 0 Then
    $Output = FileRead("C:\PcIP.ini")
    MsgBox(0, "CMD Output", $Output)


  1. Is there any other way to get a variable with a gateway of client?
  2. Is there a way to export the data to PsExec.exe \\ ComputerName ipconfig in a txt file to copy from there the gate?

I hope to help.

Edited by Bacilic

Share this post

Link to post
Share on other sites

I had the same issue, in same envoirment after migrating from XP to win8.1, was easy in XP. I must go eat now bot could help you with my solution, when came back.

...the way is powershell....


My english shucks, i know it.

Share this post

Link to post
Share on other sites

Finally I found a solutionis to enable the Remote Registry service of windows 8 at client (Launch services.msc, and then the Remote Registry).
After with a RegRead () can read information that you want, remotely.
Tried and RegWrite () but while changing the values in the registry does not correctly update the network adapter. I think this is an issue of windows 8 and requires an in-depth investigation.

Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.