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

Maximize speed, performance and reliablity of your PCs and servers—automatically!Speed Up Your PC! Try Diskeeper 2008 with InvisiTasking Free Now! Microsoft Learning Snack - Green IT Through Virtualization Many organizations face rising operating costs caused by excessive energy consumption. Virtualization and "Green IT" can help cut these costs. Get the information you need to bring Green IT savings to your business. Order Your Fundamentals CD Today!Register today for your in-depth copy of one of three Fundamental CDs on the following topics – Exchange, SQL, and SharePoint. Microsoft Learning Snack - Virtualization With Windows Server 2008Windows Server 2008 includes virtualization technology that allows many operating systems - including open source - to run on a single host. Come learn the basics of implementing these features. Microsoft Learning Snack - Virtualization BasicsWith virtualization, computing components essentially become on-demand services, freeing each element of a system from the others. This short video explains the needs, benefits, and technologies behind virtualization. Microsoft Learning Snack - Virtualization BasicsWith virtualization, computing components essentially become on-demand services, freeing each element of a system from the others. This short video explains the needs, benefits, and technologies behind virtualization. Microsoft Learning Snack - Virtualization With Windows Server 2008Windows Server 2008 includes virtualization technology that allows many operating systems - including open source - to run on a single host. Come learn the basics of implementing these features. Empower Your Processes with PowerShell 201Paul Robichaux delves deep into PowerShell how-tos in 3 informative lessons, each followed by live Q&A—all on your own computer! Register today! Microsoft Learning Snack - Green IT Through VirtualizationMany organizations face rising operating costs caused by excessive energy consumption. Virtualization and "Green IT" can help cut these costs. Get the information you need to bring Green IT savings to your business. New Release: Windows IT Pro Master CD13 years of content archives, fast answers with advanced search tools, and full access to WindowsITPro.com—order today!

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