1

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
0

1 Answer 1

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .