Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Trying to execute a batch file on a remote computer

$
0
0

I have a VB procedure that loops through many elements in an array.  This used to work fine on a XP machine, but it was just upgraded to Windows 7, and now it doesn't work.

Shell ("psexec \\" & rCell & " C:\Windows\post-script.bat")

rCell is a name in a name in an Excel Cell. 

I've tried a bunch of things.  This looked promising, but didn't work.

Set objShell = CreateObject("wscript.shell")
objShell.Run ("runas /user:domain\administrator psexec \\" & rCell & " C:\Windows\post-script.bat"), 1, True

Has anyone tried this and gotten it to work? If so, please do share!!


Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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