Link to home
Start Free TrialLog in
Avatar of niger007
niger007

asked on

Shell Command in vb.net



I had a program which will convert the content of text file into a desired format and inorder to run this pro we need to pass in input filename paramter and keyword /p and will generate a txt in the working ditector. I have excecuted the below syntax in command prompt and the conversion works fine.

CD C:\Program Files

CD My Converter

C:\ProgramFiles\MyConverter>Converter /p c:\test2.txt

Conversion sucessful

VB.net code


        Dim stemp As String
        stemp = "cmd /c c:\Program Files\MyConverter\Converter.exe /p " + "c:\test2.txt "
        Shell(stemp)
 
But .net code does nt work..What seems to be the problem lately. Experts, pls advice.
       
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
niger007,

You might also want to check the Process.Start method that is more .Net-ish!
Avatar of niger007
niger007

ASKER

David Bro,

Awesome.... it is working now..

Niger.