Execute a vb script on a remote machine


I have a vb script which tells if a machine is DHCP enabled or not i need to run this script on remote machines.Pstool is useful but do not know if it is possible.

I need pstool to collect the machine name from the file where it needs to execte abc.vbs file.

LVL 11
Who is Participating?
markpalinuxConnect With a Mentor Commented:

I use
psexec \\machinename -u domain\admin -p passwword -d -f -c batchforremote.cmd

then batchforremote.cmd would include
copy /y \\server\share1 myvbscript.vbs
cscript myvbscript.vbs > myvbscript-results.txt
copy myvbscript-results.txt \\server\share2\%COMPUTERNAME%.txt

as you can see in the batchforremote.cmd file the last file copy uses the embeeded %COMPUTERNAME% when it copies the file to the network.

I think you may also be able to run a WMI script to get what you are looking for, which would work remotely.

Hope this helps,
Alan Huseyin KayahanCommented:
        *You would schedule the script in "scheduled tasks" if you like.
         *Is this Professional Service Tool you mean wit pstool? If yes link below is the offical forum and you may find many solutions if you join and check.
bsharathAuthor Commented:
How can i schedule on a remote machine remotely
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Alan Huseyin KayahanCommented:
         *If you have a domain, you would execute your script as logon or logoff script for users in AD pane.
bsharathAuthor Commented:
Yes i have a domain but there is a output which is required this script shows a window on the screen if it is a DHCP or not.
bsharathAuthor Commented:
Can we do the same thing for vb scripts .vbs
If it is a command line vb script compiled to an exe, then sure then you would just use file.exe > %computername%.txt adn then copy it to the network.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.