Adding Inverted Commas in VBScript


I use VBScript to add the below line to HKLM\Sofware\Microsoft\Windows\CurrentVersion\Run.

wscript.exe C:\Documents and Settings\Administrator\Desktop\Domain12.vbs

It adds the line to registry but I want it to be added in the below format (With Inverted Comma's)

wscript.exe "C:\Documents and Settings\Administrator\Desktop\Domain12.vbs"

I use the following command:
strCommand = "cmd /c REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v ""VBS Join Domain"" /d ""wscript.exe C:\Documents and Settings\Administrator\Desktop\Domain12.vbs /f"

What are the changes i have to make in the above command. Please help.
LVL 14
Dhiraj MuthaLevel DAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If I understand your question correctly something like this might work

strCommand = "cmd /c REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v ""VBS Join Domain"" /d ""wscript.exe " & chr(34) & "C:\Documents and Settings\Administrator\Desktop\Domain12.vbs" & chr(34) & " /f"

Good luck

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dhiraj MuthaLevel DAuthor Commented:
If i use this comamnd to output on a msgbox it shows fine. But in registry it add like this:

This is what i see in registry:
wscript.exe  chr(34)C:\Documents and Settings\Administrator\Desktop\Domain12.vbschr(34)  /f

Can you help on this?
Dhiraj MuthaLevel DAuthor Commented:
It was ok. But did not resolved my issue.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.