PsExec in VB scripts ..

PsExec – is a free tool/utility that let you execute some processes on remote machine. It is very powerful tool and there are many uses for network admin to make his life easy.

Here is simple integration of the tool into VB script (simple copy/paste and save as VBS file):

Initiate the WSUS client on remote computer

StrComputer = “.”
Set wshShell = CreateObject(“WScript.Shell”)
wshShell.Run “C:Toolspsexec.exe \” & strComputer & ” wuauclt /detectnow ”

Register DLL file on remote computer

StrComputer = “.”
Set wshShell = CreateObject(“WScript.Shell”)
wshShell.Run “C:Toolspsexec.exe \” & strComputer & ” regsrv32 /s MyDLL.dll ”

Just make sure you update your PATH where you have your PSExec.exe file .. as you see in my case – it is under C:Tools folder — this is where I keep some handy tools for my use

Leave a Reply