|
-
Jun 22nd, 2004, 08:04 AM
#1
Thread Starter
Fanatic Member
string
Hi,
If I run the following line in the RUN dialog box (i.e. start, run window) it works fine (Notice the double quotes at the beginning, middle and the end):
"\\W-I55ZB6B7\c$\Program Files\game" \\psiukapp6\test.zip ckff.ckff.asc \\W-I55ZB6B7\c$\test"
but when this line is created in c# it is not quite the same (Notice the double quotes) and therefore I can not run it using System.Diagnostics.Process.Start
strLine = @"\\W-I55ZB6B7\c$\Program Files\game \\psiukapp6\test.zip capt.capt.asc \\W-I55ZB6B7\c$\test"
System.Diagnostics.Process.Start(strLine)
The error is: system can not find the file specified.
How is it possible to make the c# created string as same as the one which can be run in the RUN dialog box?
Thanks
-
Jun 22nd, 2004, 10:04 AM
#2
Member
for each backslash you need to add an extra one.
so \ would become \\
and \\ would become \\\\
you could also try a single forward slash instead
ie c:/data/myfile.txt
I think there was another way where you could enter the path as is but can't remember how to do that now.
-
Jun 22nd, 2004, 10:45 AM
#3
Thread Starter
Fanatic Member
start
I don't think the problem is to do with back slash because this is really what I have
string strUnzipPath = strUnzipLocation + " " + strPath + " " + strFullFilename + " " + strTempLocation;
System.Diagnostics.Process.Start(strUnzipPath);
note that
strUnzipPath = "\"\\\\W-I55ZB6B7\\c$\\Program Files\\WinZip\\wzunzip\" \\\\psiukapp6\\pershusp\\History\\01-01-2004\\01-01-2004-pershing.zip capt.capt.asc \\\\W-I55ZB6B7\\c$\\farshad\\downloads"
Thanks
-
Jun 22nd, 2004, 12:16 PM
#4
String literals (as you originally had it fmardani) are a lot more readable IMO. Perhaps escaping the last double quotes might help you:
Code:
strLine = @"\\W-I55ZB6B7\c$\Program Files\game \\psiukapp6\test.zip capt.capt.asc \\W-I55ZB6B7\c$\test\""
-
Jun 23rd, 2004, 05:40 AM
#5
Thread Starter
Fanatic Member
Did what you suggested but still the error is: system can not find the file specified. :-( Thanks
I think there has to be a " after strUnzipLocation as I have tried doing but it does not work.
string strTempLocation = @"\\W-I55ZB6B7\c$\farshad\downloads";
string strUnzipLocation = @"\\W-I55ZB6B7\c$\Program Files\WinZip\wzunzip.exe";
string strPath = @"\\psiukapp6\pershusp\History\01-01-2004\01-01-2004-pershing.zip";
string strFullFilename = "capt.capt.asc"
string strUnzipPath = strUnzipLocation + " " + strPath + " " + strFullFilename + " " + strTempLocation;
System.Diagnostics.Process.Start(strUnzipPath);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|