Solved

wordpad bug relating to blank space in file name of document

Posted on 2009-05-08
1
289 Views
Last Modified: 2013-11-27
I am usinf vs2008 c# to open a file with wordpad.      I am using the code
System.Diagnostics.Process.Start(startInfo) to start wordpad.     The file I am interested in can contain a space.    Wordpad works fine with a file containing no spaces in the filename.
I tried adding %1% at the end of the wordpad name, but that did not work.    My code is below.
Again, this works fine for a file such as  "C:\\data1b.dat";  

Thanks mnarcowich2007                    
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
            startInfo.FileName = "wordpad.exe";
            startInfo.Arguments = "C:\\Program Files\\GuiDM\\Examples\\data1b.dat";                        
            System.Diagnostics.Process.Start(startInfo);

Open in new window

0
Comment
Question by:mnarcowich2007
[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
1 Comment
 
LVL 1

Accepted Solution

by:
Abbotshea earned 500 total points
ID: 24342016

make sure that the full name of the file is surrounded by another set of quotes.  Try:

startInfo.Arguments = "\"C:\\Program Files\\GuiDM\\Examples\\data1b.dat\"";
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

707 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