• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1229
  • Last Modified:

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
0
Diammond
Asked:
Diammond
  • 4
  • 4
  • 3
1 Solution
 
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now