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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Alan Huseyin KayahanCommented:
         *If you have a domain, you would execute your script as logon or logoff script for users in AD pane.
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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.

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,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.

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.