0

vbs code are as following :

Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
strArgs = "cmd /c REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RUN" /v "MyCustomWorkgroupUsername" /t REG_DWORD /d 0"
oShell.Run strArgs, 0, false

Error message :

Line :3
Char:28 
Error: Expected end of statement 
Code:800A0401
Source: Microsoft VBScript compilation error
1

I have used double " instead of single " and its working fine for me.

Set oShell = CreateObject ("Wscript.Shell")
    Dim strArgs
    strArgs = "cmd /c REG ADD ""HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RUN"" /v ""MyCustomWorkgroupUsername"" /t REG_DWORD /d 0"
    oShell.Run strArgs, 0, false

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.