Solved

wordpad bug relating to blank space in file name of document

Posted on 2009-05-08
1
285 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
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…

735 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