Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

psexec and vb.net

Posted on 2014-10-18
2
194 Views
Last Modified: 2014-10-18
0

down vote

favorite


 


I made a small program which launches an .exe on a remote computer. When I run psexec from a CMD prompt, it works fine, when I run it in VB it errors with, "Cannot find file specified".

Dim targetpc As String = "192.168.1.3"
        Try
            Dim p As New Process()
            p.StartInfo.FileName = "C:\Users\johndoe\Desktop\PSTools\psexec.exe"
            p.StartInfo.Arguments = "\\" & targetpc & " " & "C:\Program Files (x86)\AVS4YOU\AVSAudioConverter\AVSAudioConverter.exe"
            p.Start()
            p.WaitForExit()
        Catch ex As Exception
            MsgBox("Shit didnt work")
        End Try

Open in new window


Is my concat string correct? What am I missing here.
0
Comment
Question by:derek7467
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 40388719
the problem are the spaces in you arguments, you need to send them with double quotes around them:

 p.StartInfo.Arguments = "\\" & targetpc & " " & chr(34) & "C:\Program Files (x86)\AVS4YOU\AVSAudioConverter\AVSAudioConverter.exe" & chr(34)

Open in new window

0
 

Author Closing Comment

by:derek7467
ID: 40389248
thank you!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question