|
-
Jan 17th, 2010, 08:46 AM
#1
Thread Starter
Lively Member
Whats wrong with this line
Can anyone tell me what is wrong with the following line.
Code:
Process.Start("regedit", "/S Environ("%systemdrive%") &"\FixAVI.reg")
I get err with the "%" = Character is not valid.
< advertising link removed by moderator >
-
Jan 17th, 2010, 09:15 AM
#2
Re: Whats wrong with this line
Your double quotes are messed up. You can't just plop a double quote into a string because it's interpreted as the end of the string. If you want a double quote in a string you have to escape it, e.g.
vb.net Code:
Dim str As String = "He said ""Hello"" to me."
Last edited by jmcilhinney; Jan 17th, 2010 at 09:21 AM.
Reason: Added a fairly important "can't".
-
Jan 17th, 2010, 09:20 AM
#3
Re: Whats wrong with this line
Look at the number of quotes you are providing...
[EDIT] - Jmchilhinney beat me to it as I was preparing a nice brightly coloured example of what was code and was string!
-
Jan 17th, 2010, 09:57 AM
#4
Thread Starter
Lively Member
Re: Whats wrong with this line
So how do I do that.
I just want to run REG file located at SystemRoot, but in silent mode
< advertising link removed by moderator >
-
Jan 17th, 2010, 10:38 AM
#5
Re: Whats wrong with this line
jmcilhinney gave you an example - just double up your quotes which form part of the string literal.
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
|