I have made a batch file that should create vbscript that creates a shortcut of a certain file depicted by the choice command. The only problem is I keep getting a expected end of statement error. I'm assuming it's a Syntax error. (sorry I don't explain it well as I am new to Vbs) here is the code
@echo off
Title Dragonball Z
cls
echo Please Type The Number Corosponding To Your Chosen Title
more "%USERPROFILE%\Documents\ROMS\GB\DRAGONBALL Z\Titles.txt"
%SystemRoot%\System32\choice.exe /C 12345 /N /M ":"
if errorlevel 5 goto tlog2
if errorlevel 4 goto tlog
if errorlevel 3 goto t
if errorlevel 2 goto ssw
if errorlevel 1 goto bf
:bf
set DIR=""%USERPROFILE%\Documents\ROMS\GB\DRAGONBALL Z\BUU'S FURY\Dragonball Z Buu's Fury.GBA""
set game="Buus Fury"
goto END
:ssw
set DIR="%USERPROFILE%\Documents\ROMS\GB\DRAGONBALL Z\SUPERSONIC WARRIORS\DragonBall Z Supersonic Warriors.gba"
set game="Supersonic Warriors"
goto END
:t
set DIR="%USERPROFILE%\Documents\ROMS\GB\DRAGONBALL Z\Taiketsu\Dragonball Z Taiketsu.GBA"
set game="Taiketsu"
goto END
:tlog
set DIR="%USERPROFILE%\Documents\ROMS\GB\DRAGONBALL Z\THE LEGACY OF GOKU\Dragonball Z the Legacy of Goku.GBA"
set game="The Legacy of Goku"
goto END
:tlog2
set DIR="%USERPROFILE%\Documents\ROMS\GB\DRAGONBALL Z\THE LEGACY OF GOKU 2\Dragonball Z the Legacy of Goku 2.GBA"
set game="The Legacy of Goku 2"
goto END
:END
set SCRIPT="%USERPROFILE%\Documents\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\%game%.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = %DIR% >> %SCRIPT%
echo oLink.Save >> %SCRIPT%
cscript /nologo %SCRIPT%
del %SCRIPT%
rem Here I keep getting a Expected End Of statement error
pause
any help will be appreciated