?
Solved

Using Psexec in Vbscript to Register DLL on Remote Machine

Posted on 2012-04-06
11
Medium Priority
?
1,219 Views
Last Modified: 2012-04-06
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
Comment
Question by:Diammond
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37816384
is the psexec already copied locally in remote machine?
0
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37816409
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
 

Author Comment

by:Diammond
ID: 37816412
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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37816418
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
 

Author Comment

by:Diammond
ID: 37816463
New syntax is failing as well.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37816804
Do you have rights on the remote machine?
0
 

Author Comment

by:Diammond
ID: 37816842
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
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1400 total points
ID: 37816873
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
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37816887
Nice catch......
0
 

Author Comment

by:Diammond
ID: 37816917
I'm so embarrassed.  Sometimes it takes an extra pair of eyes.

Thanks all for your help!

Diammond
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37816951
Sometimes it takes an extra pair of eyes.
I think that's one of the tenets of software development  = )
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question