1
votes

I get a compilation error when I try to run the following vbs code from a command prompt in Windows 7 Vista. I've already Coverted it to ANSI but it still has the same problem

Set wshShell =wscript.CreateObject(“WScript.Shell”)
do
wscript.sleep 100
wshshell.sendkeys “{CAPSLOCK}”
wshshell.sendkeys “{NUMLOCK}”
wshshell.sendkeys “{SCROLLLOCK}”
loop

it says the issue is in Line 1 Char 36... Got Any Ideas?

2

2 Answers

0
votes

This should works just give a try :

Because this is diffrent from this " and this diffrent from "

Set wshShell = CreateObject("WScript.Shell")
do
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
wshshell.sendkeys "{NUMLOCK}"
wshshell.sendkeys "{SCROLLLOCK}"
loop
0
votes

You used Word as an editor, Word uses smart quotes. Autocorrect in Word changes " to opening and closing printers's quotes (ie 66 and 99).

Press Ctrl + Z to undo the change while typing or change options in Tools - Options - Autocorrect.