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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:01:05+00:00 2026-05-23T04:01:05+00:00

I am shelling in the a few push d statements based on a list

  • 0

I am shelling in the a few push d statements based on a list of users from the active directory. 2 for example are

java.exe -version 

and

dir /s 

The search actually seems to search the actual computer and output the files from their directory. However, the java.exe only outputs the actual output from the computer that it is being ran on.

Is this even possible to run a remote exe from the pushd statement? Any thoughts would be great.

Here is the code as of right now in a simplified version. Let me know if anyone would like more.

Dim sCommand as String = "pushd \\***\C$ && java.exe -version 2>>C:\Testfile.txt" 
Dim sCommand2 as String = "pushd \\***\C$ && dir /s blah.blah>>C:\Testfile.txt"  

For each SelectedItem in Listbx.SelectedItems 
Dim ReplaceCommand as String = sCommand.Replace("***", SelectedItem) 
Shell("cmd.exe /c" & ReplaceCommand, True)  
Dim ReplaceCommand as String = sCommand2.Replace("***", SelectedItem) 
Shell("cmd.exe /c" & ReplaceCommand2, True, -1) 
Next
  • 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-05-23T04:01:06+00:00Added an answer on May 23, 2026 at 4:01 am

    To me, you’ll need to find on the remote computer first the location of the JAVA executable. Your commands you’re executing on the shell will search your local defined paths, not the remote paths.

    Consider this.
    enter image description here

    first execution is local > running java 1.6.0.23

    then I pushd to another computer. I re-execute the same command.
    Since i’m not in the remote directory containing the java.exe file, it’ll process my path to find it. >same version is returned

    I then change to the remote’s Java container and re-execute the statement.
    This time it’s finding the remote Java.exe and processes the command.

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

Sidebar

Related Questions

Is there a better way to call MSBuild from C#/.NET than shelling out to
I would like to build my own custom DI framework based on Java annotations
From the should be simple, but... files: Trying to get started with jQuery UI.
I'm looking for a C# version of the following command: sc config someServiceName start=auto
Firstly this site is based on guests who are interested in selling their items
I'm considering writing my own delivery code using PowerShell and/or C#, maybe shelling to
How can I detect if my Swing App is being run from a windows
Task Downloading binary files from a remote media processing server to a web server.
I have a Rakefile with a Rake task that I would normally call from
How can I create 7-Zip archives from my C# console application? I need to

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.