Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

PsExec.exe not working from AU3 script

$
0
0

I am trying to push execution of an EXE on a set of machines on my network.  I am probably missing something simple, but I cannot make the code below work.

  1. PushIt("testpc")
  2.  
  3. Func PushIt($pcname)
  4.     $executor = @ComSpec & " /c " & @ScriptDir & "\PsExec.exe \\" & $pcname & " -s -d C:\Windows\apptopush.exe"
  5.     If Ping($pcname, 2000) = 0 Then Return 0
  6.     If Not FileCopy("apptopush.exe", "\\" & $pcname & "\c$\Windows\", 1) Then Return 0
  7.     RunWait($executor, @SW_SHOW)
  8.     ConsoleWrite($executor & @CRLF)
  9.     Return 1
  10. EndFunc   ;==>PushIt

I have full admin rights on all of the local PCs, including the 'testpc', so this is running with my domain credentials.

When I run it, the exe copies to the remote system, but the exe never executes on the remote system.

If I copy the command from the console, and paste it into a CMD shell from the script path, it runs the exe on the remote, no problem.

 

What am I missing?

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>