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 8603919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:26:20+00:00 2026-06-12T02:26:20+00:00

I have two physical machine. The first machine want to execute a bat file

  • 0

I have two physical machine. The first machine want to execute a bat file on the second machine. I create a share location on the second server and tried to run it from the first machine and it does not work. The bat file can run on the local machine properly.

This is an example of code inside the bat file. It is just a bat to create file.

echo. 2>EmptyFile.txt

This is the code that I use to execute bat file.

private static void ExecuteBatFile()
{
    System.Diagnostics.Process proc = new System.Diagnostics.Process();
    System.Security.SecureString ssPassword = new System.Security.SecureString();

    proc.StartInfo.UseShellExecute = false;
    proc.StartInfo.FileName = @"\\my_remote_server\my_bat.bat";
    proc.StartInfo.Domain = "my_domain";
    proc.StartInfo.UserName = "my_username";

    Console.Write("Enter your password: ");
    string password = Console.ReadLine();

    for (int x = 0; x < password.Length; x++)
    {
        ssPassword.AppendChar(password[x]);
    }

    proc.StartInfo.Password = ssPassword;
    proc.Start();
}

I want to know how can I run bat file on remote server?

  • 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-12T02:26:21+00:00Added an answer on June 12, 2026 at 2:26 am

    You can execute commands on remote machines using PsExec. I use it to execute batch files and pass parameters to them.

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

Sidebar

Related Questions

I have two files client.php and server.php. The client file send a HTTP request
I have two Physical CPU in one of my Server. I see both of
I have two issues here, the second one is irrelevant if the first one
We have two different ldap providers in two different physical office locations. When I
I have two processes which access to the same physical memory(GPIO data addr). So
I have two update panels on a page. And I want to update both
I have two physical servers. The old one runs an ASP.NET site on IIS
Lets say I have two separate databases, X and Y, on the same physical
I have two apache virtual hosts within the same domain (and on same physical
Let's say I have a file located at C:\foo\bar.js and I want to include

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.