• 0

[VB.NET] Remote Shell Command Help (please!)


Question

Hello All, just found out about Neowin, looks fantastic!

I have what I think is a very simple question in VB.NET, I'm just starting out with the language.

To run a standard application, I typically run:

Shell(mxcl -d)

within a button to launch the program in question. I'd like however to be able to run this command to a comptuer on my lan (remote computer). I've tried PsExec with no luck. I've tried something along the lines of:

Shell(psexec \\computerName -u "my name" -p Password "mxcl -d")

Not sure if I'm using PsExec correctly, but that's besides the point. I don't need to use PsExec at all, just want my remote computers to launch these programs!

Thanks for reading, any help would be greatly appreciated!

hahaha: "Resident One Post Wonder"... i'm new!

4 answers to this question

Recommended Posts

  • 0
  cicero38 said:
Hello All, just found out about Neowin, looks fantastic!

I have what I think is a very simple question in VB.NET, I'm just starting out with the language.

To run a standard application, I typically run:

Shell(mxcl -d)

within a button to launch the program in question. I'd like however to be able to run this command to a comptuer on my lan (remote computer). I've tried PsExec with no luck. I've tried something along the lines of:

Shell(psexec \\computerName -u "my name" -p Password "mxcl -d")

Not sure if I'm using PsExec correctly, but that's besides the point. I don't need to use PsExec at all, just want my remote computers to launch these programs!

Thanks for reading, any help would be greatly appreciated!

hahaha: "Resident One Post Wonder"... i'm new!

Welcome!

For me, the shell command never seems to pass arguments correctly.

You can try using the System.Diagnostics.Process class to start a new process and pass arguments to it.

You use the Process.StartInfo.FileName attribute to launch your application.

Use the Process.StartInfo.Arguments attribute to list the program arguments.

Process.Start() starts the application.

To point you in the right direction, it would look something like this:

Imports System.Diagnostics 'At the top of your code

Dim p As New Process()

p.StartInfo.FileName = "psexec"
p.StartInfo.Arguments =  "\\computerName -u "my name" -p Password "mxcl -d"
p.Start()

For more information, see the MSDN documentation.

  • 0

Thanks xcguy87 and Rudy.

Going to try making a new Process, sounds very straightforward, thanks for the tip! Will post my results even if it works.

But what does it mean, when one says "you need to start escaping stuff"? Sorry, still learning the programming lingo.

  • 0
  cicero38 said:
Thanks xcguy87 and Rudy.

Going to try making a new Process, sounds very straightforward, thanks for the tip! Will post my results even if it works.

But what does it mean, when one says "you need to start escaping stuff"? Sorry, still learning the programming lingo.

He's referring to the fact that I didn't use escape characters when showing you the code examples...

It should have been:

Dim p As New Process()

p.StartInfo.FileName = "psexec"
p.StartInfo.Arguments =  "\\computerName -u ""my name"" -p Password ""mxcl"" -d"
p.Start()

(notice the double quotation marks?)

The VB.NET compiler associates a quotation mark with the end of a string. Double quotation marks indicate to insert a quotation mark character, instead of indicating the end of the string. The example I gave early would produce compiler errors.

Sorry about that, I usually develop in c# and couldn't remember visual basic's escape character's off hand.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • GPUs selling higher than their MSRP is the new norm it seems. This shouldn't surprise anyone. Dumb duopoly, if Intel could just stop shooting itself in the foot and release some more cards and undercut the other two that'd be great.
    • I saw that recently, and the thing that would be useful also would be to have the PC model in that spec card as well. I know that it's on the main portal page of System, but repeating it in this "Device specs" module, especially if it's meant for the main specs of the computer, would certainly be useful.
    • Do you want a little in the ground or a lot in the air?
    • Bethesda readying two updates for Oblivion Remastered targeting bugs and performance by Pulasthi Ariyasinghe The surprise release of The Elder Scrolls IV: Oblivion Remastered was a massive success for Bethesda and Microsoft, with the title going on to gain over four million players in just three days at launch while also breaking franchise records for concurrent players. While reactions to the game have been positive from both critics and players, plenty of complaints have since been pouring in about the state of the remaster. Now, Bethesda is aiming to push out updates to resolve these concerns. Today, the company revealed that two updates are currently planned for the RPG, both with different scopes. The first of these is already available in beta form to Steam players. It seems Bethesda is using the same beta update format it uses for Starfield for this Elder Scrolls entry as well. "Thanks for all your excitement and feedback since the launch of The Elder Scrolls IV: Oblivion Remastered," said the development team today. "We are actively working on two separate updates to be launched in the coming weeks, both of which will come to our Steam Beta first, before being released to all other platforms." According to the studio, the first update is focused on "quests, major bugs and blockers, and quality of life fixes. " Following the June 5 launch on the Steam beta platform, all other PC players, as well as those on Xbox Series X|S, PlayStation 5, and Game Pass subscribers, will receive the update on June 11. The beta changelog for Update 1.1 can be seen here, with bug fixes coming for the UI, gameplay, quests, and more. Multiple crashes have been resolved here, with many being related to loading saves and exploring specific locations. Instances of infinite loading, alt-tab freezing, resetting settings, and more are being targeted with fixes, too. To opt into the Elder Scrolls IV: Oblivion Remastered beta update, Steam players can head into the game's properties, select Betas, and choose the [beta] branch to receive the new build. While Bethesda hasn't revealed any release dates for the second update, it did say that improving performance will be its main focus. This is a major point of criticism for the title at the moment, so the update can't come soon enough.
    • I wouldn't consider it harsh, but companies want as many loopholes and exceptions as possible. I agree on wanting everything to be above board. Hopefully they find a way to do this.
  • Recent Achievements

    • Week One Done
      jbatch earned a badge
      Week One Done
    • First Post
      Yianis earned a badge
      First Post
    • Rookie
      GTRoberts went up a rank
      Rookie
    • First Post
      James courage Tabla earned a badge
      First Post
    • Reacting Well
      James courage Tabla earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      408
    2. 2
      +FloatingFatMan
      181
    3. 3
      snowy owl
      179
    4. 4
      ATLien_0
      171
    5. 5
      Xenon
      135
  • Tell a friend

    Love Neowin? Tell a friend!