Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8277419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:41:16+00:00 2026-06-08T08:41:16+00:00

I am doing some research to find out the best and most efficient method

  • 0

I am doing some research to find out the best and most efficient method for this.
I will need to execute remote scripts on a number of Window Servers/Computers (while we are building them).

I have a web application that is going to automate this task, I currently have my prototype working to use PsExec to execute remote scripts. This requires PsExec to be installed on the system. A colleague suggested I should use WMI for this.

I did some research in WMI and I couldn’t find what I’m looking for.
I want to either upload the script to the server and execute it and read the results, or already have the script on the server and execute it and read the results. I would prefer the first option though!

Which is more ideal, PsExec or WMI?

For reference, this is my prototype PsExec code. This script is only executing a small script to get the Windows OS and Service Pack Info.

Protected Sub windowsScript(ByVal COMPUTERNAME As String)
        ' Create an array to store VBScript results
        Dim winVariables(2) As String
        nameLabel.Text = Name.Text
        ' Use PsExec to execute remote scripts
        Dim Proc As New System.Diagnostics.Process
        ' Run PsExec locally
        Proc.StartInfo = New ProcessStartInfo("C:\Windows\psexec.exe")

        ' Pass in following arguments to PsExec
        Proc.StartInfo.Arguments = COMPUTERNAME & " -s cmd /C c:\systemInfo.vbs"
        Proc.StartInfo.RedirectStandardInput = True
        Proc.StartInfo.RedirectStandardOutput = True
        Proc.StartInfo.UseShellExecute = False
        Proc.Start()
        ' Pause for script to run
        System.Threading.Thread.Sleep(1500)
        Proc.Close()

        System.Threading.Thread.Sleep(2500) 'Allows the system a chance to finish with the process.
        Dim filePath As String = COMPUTERNAME & "\TTO\somefile.txt"
        'Download file created by script on Remote system to local system
        My.Computer.Network.DownloadFile(filePath, "C:\somefile.txt")
        System.Threading.Thread.Sleep(1000) ' Pause so file gets downloaded
        ''Import data from text file into variables
        textRead("C:\somefile.txt", winVariables)
        WindowsOSLbl.Text = winVariables(0).ToString()
        SvcPckLbl.Text = winVariables(1).ToString()
        System.Threading.Thread.Sleep(1000)
        ' ''Delete the file on server - we don't need it anymore
        Dim Proc2 As New System.Diagnostics.Process
        Proc2.StartInfo = New ProcessStartInfo("C:\Windows\psexec.exe")
        Proc2.StartInfo.Arguments = COMPUTERNAME & " -s cmd /C del c:\somefile.txt"
        Proc2.StartInfo.RedirectStandardInput = True
        Proc2.StartInfo.RedirectStandardOutput = True
        Proc2.StartInfo.UseShellExecute = False
        Proc2.Start()
        System.Threading.Thread.Sleep(500)
        Proc2.Close()
        ' Delete file locally
        File.Delete("C:\somefile.txt")
 End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:41:17+00:00Added an answer on June 8, 2026 at 8:41 am

    From additional research, for this type of project it looks like PsExec is the best route to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After doing some research on this issue, I couldn't find any satisfying fix. The
I've been doing some research on path-dependent types. The best description I could find
I have been doing some research on test driven development and find it pretty
To all: This question pertains to some MS research I am doing. What I
I think it is not complicated but after doing some research I can't find
This is a homework problem that I have. I have been doing some research
Ive been doing some research and I cant seem to find anything on writing
I'm doing some research on the feasibility of an iPhone application, and can't find
After doing some research about namespacing in PHP I'm trying to figure out what
I'm planning out a science project, and I'm doing some research about sockets in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.