[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Shell Command in vb.net

Posted on 2006-10-29
3
Medium Priority
?
13,034 Views
Last Modified: 2012-05-05


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.
       
0
Comment
Question by:niger007
[X]
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
  • 2
3 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 17831613
Hi niger007,

it might be the space in the path.

try this:
stemp = "cmd /c " + chr(34) + "c:\Program Files\MyConverter\Converter.exe" + chr(34) + " /p " + "c:\test2.txt "


Cheers!
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 17831616
niger007,

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

Author Comment

by:niger007
ID: 17831659
David Bro,

Awesome.... it is working now..

Niger.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

656 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