Welcome to Scripting Forums Sign in | Join | Help
in Search

Using psexec in a vbscript

Last post 04-18-2007, 3:15 PM by AbqBill. 4 replies.
Sort Posts: Previous Next
  •  04-18-2007, 3:15 PM 679

    Using psexec in a vbscript

    Could someone tell me if the syntax for this line is correct?

     

    Set WshShell = WScript.CreateObject("WScript.Shell")
    Return = WshShell.Run("psexec.exe \\" & strServer & _
      & " -u domain\userid -p password regsvr32.exe C:\WINDOWS\system32\hhctrl.ocx", 4, true)

     

    The second parameter (4) should leave the active window active, but it launches a new windows and never closes.

    There is no indication that it is still running or that it failed.

     

    Thanks

  •  04-18-2007, 3:32 PM 680 in reply to 679

    Re: Using psexec in a vbscript

    In looking at my post I typed an extra "&" on the continuing second line, which I don't have in my script.

    Thanks 

     

  •  04-20-2007, 11:50 PM 691 in reply to 679

    Re: Using psexec in a vbscript

    Hi operez,

    I have a couple of comments on the snippet of script code that you posted:

    First, it seems like it's your intention to register the file hhctrl.ocx on a remote computer. Is this correct? If so, keep in mind that psexec executes the command as if you were sitting at the other computer's console; that is, the hhctrl.ocx path and file name must exist on the remote system, in that exact location.

    Second, if you run regsvr32.exe without /s, it executes and displays a message box ("hhctrl.ocx was registered successfully"). I think you probably want the /s option after the regsvr32.exe command.

    Let me know if this helps you get done what you need.

    Bill

  •  04-24-2007, 8:41 AM 697 in reply to 691

    Re: Using psexec in a vbscript

    Thanks for your response Bill, I have been busy fighting other fires.

     

    The hhctrl.ocx path is the same as if I was logged into the console of the remote server and actually runs logged into the remote server, but not from the script, using psexec.  The /s I figured out after a good nights sleep, but again thanks for your response.

  •  04-24-2007, 9:55 AM 699 in reply to 697

    Re: Using psexec in a vbscript

    Hi operez,

    If I understand your response, your problem is resolved. If not, feel free to post back here.

    Regards,

    Bill
     

View as RSS news feed in XML
SPONSORED LINKS FEATURED LINKS

Free Download –VS 2008 TrainingExperts Ken Getz & Robert Green plus labs, code, courseware Maximize speed, performance and reliablity of your PCs and servers—automatically!Speed Up Your PC! Try Diskeeper 2008 with InvisiTasking Free Now! Register for SolarWinds VM MonitorGet X-Ray Vision into Your ESX Servers with SolarWinds FREE VM Monitor GoGrid Offers FREE Trial for Windows Cloud ServersDeploy Windows Server 2003 and 2008 with free load balancing through GoGrid’s award winning web-based GUI – all in less than 5 minutes Order Your SQL Fundamentals CD Today! Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD. How healthy is your Exchange Server? Find out Now!Automatic Exchange Server Maintenance helps prevent disasters and improves performance. Download a FREE Exchange Server analysis tool. You've Deployed SharePoint...Now What?This one-day free online conference delivers the technical knowledge needed to kick MOSS up a notch. In one information-packed day, independent SharePoint experts will present practical, real-world information and provide take-away, ready-to-use solutions Ease Your Scripting Pains with the Flexibility of PowerShell!Paul Robichaux equips you with PowerShell basics in 3 introductory lessons, each followed by live Q&A—all on your own computer! Register today! What Would You Do If You Ran Microsoft?ITTV's 2008 inaugural video contest, "If I Ran Microsoft..." is your chance to tell it like it is. Be goofy or be serious, but don"t miss this chance to have fun, win prizes, and go viral in a major way. Maximize Your SharePoint InvestmentThis web seminar discusses how true bi-directional replication of SharePoint content from one server to another enables branch offices to maintain access to current SharePoint content. Rock Your Knowledge, and Compete with Friends and Colleagues!Are you the Web Application Performance Guru in your office? It's time to have fun! Download now to access the crossword puzzle. Challenge yourself and complete this fun activity!

 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing