This code is for the Windows Scratch 1.4 shortcut incase you deleted it. It only works well if you installed Scratch in the default location. Copy and paste the following code in a Notepad document and save it anywhere as "Any name you want here.bat" ; including the quatation marks.
@ECHO off Title Start MIT Scratch cls ECHO Starting MIT Scratch. Please wait... IF EXIST "C:\Program Files (x86)\Scratch" GOTO x86 IF EXIST "C:\Program Files\Scratch" GOTO PF IF EXIST "C:\Scratch" GOTO C ECHO. ECHO System could not find MIT Scratch in C:\, C:\Program Files\, or C:\Program Files (x86)\. GOTO Retry :Retry ECHO. set /p var=Did you install the program somewhere else? (Yes/No) If %var%==yes GOTO Different If %var%==Yes GOTO Different If %var%==no GOTO Error If %var%==No GOTO Error GOTO Retry :Different ECHO. ECHO Type in the Drive:\Path\ (With the Scratch file path at the end.) Make sure to use the ending \ mark. set /p var=Drive:\Path\ - If NOT EXIST "%var%scratch.exe" GOTO Error cd "%var%" start scratch.exe exit :Error ECHO. ECHO Could not find the file. Contact the website directors/administrators. ECHO. ECHO Closing... ECHO. Pause Exit :PF cd "C:\Program Files\Scratch\" start scratch.exe exit :x86 cd "C:\Program Files (x86)\Scratch\" start scratch.exe exit :C cd "C:\Scratch\" start scratch.exe exit
Open it and it should open Scratch Please report any bugs.
Offline
That's a pretty cool application of Batch code to the Scratch world!
Do you think that could be expanded to actually create a wizard that finds the program, and then creates the shortcut automatically for future uses, without having to go through the process again?
Consider using IF EXIST command to check for a file or directory, without having to actually ask the user and depend on what they tell you!
Offline
LS97 wrote:
That's a pretty cool application of Batch code to the Scratch world!
Do you think that could be expanded to actually create a wizard that finds the program, and then creates the shortcut automatically for future uses, without having to go through the process again?
Consider using IF EXIST command to check for a file or directory, without having to actually ask the user and depend on what they tell you!
I could try, but I don't know how to create a shortcut in cmd .
Offline