Using Psexec in Vbscript to Register DLL on Remote Machine

Hello,

I am trying to use psexec in a vbscript to register a dll on remote machines.  The below syntax does not appear to be working.  Can you suggest what is wrong with the syntax?

strFile = " \\" & strComputer & " "

Set wshShell = CreateObject("WScript.Shell")


intRegister = wshShell.Run("C:\temp\pstools\psexec.exe" & strFile & "regsrv32.exe /s c:\winnt\system32\some.dll")


Any help would be greatly appreciated.

Thanks
Diammond
DiammondAsked:
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.

AnuroopsunddCommented:
is the psexec already copied locally in remote machine?
0
AnuroopsunddCommented:
strFile = " & strComputer & "
Set wshShell = CreateObject("WScript.Shell")

intRegister = wshShell.Run("C:\temp\pstools\psexec.exe \\” & strComputer & "regsrv32.exe /s c:\winnt\system32\some.dll")


try above.....
0
DiammondAuthor Commented:
Hello,

Thanks for responding.  No, it's being executed from my computer.  I can type the command at a DOS prompt and it registers the remote dll.  It is not working via the script.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

AnuroopsunddCommented:
Set wshShell = CreateObject("WScript.Shell")

intRegister = wshShell.Run("C:\temp\pstools\psexec.exe \\” & strComputer & " regsrv32.exe /s c:\winnt\system32\some.dll")


Ok.. can you try above script..
0
DiammondAuthor Commented:
New syntax is failing as well.
0
käµfm³d 👽Commented:
Do you have rights on the remote machine?
0
DiammondAuthor Commented:
Thanks for responding.  

Yes, I have admin rights and I can also run the command successfully from a DOS prompt.  There is a syntax error somewhere in the code.
0
käµfm³d 👽Commented:
The register command is regsvr32 I believe. I think you have the "r" and "v" transposed. Try:

intRegister = wshShell.Run("C:\temp\pstools\psexec.exe" & strFile & "regsvr32.exe /s c:\winnt\system32\some.dll")

Open in new window

0

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
AnuroopsunddCommented:
Nice catch......
0
DiammondAuthor Commented:
I'm so embarrassed.  Sometimes it takes an extra pair of eyes.

Thanks all for your help!

Diammond
0
käµfm³d 👽Commented:
Sometimes it takes an extra pair of eyes.
I think that's one of the tenets of software development  = )
0
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
VB Script

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.