Skip to content

Instantly share code, notes, and snippets.

@keeganwitt
Last active Sep 29, 2015
Embed
What would you like to do?
Deletes temp file that prevents RIS 2.0 from launching correctly on newer versions of Windows then launches RIS 2.0
@echo off
rem Author: Keegan Witt
rem Description: Deletes temp file that prevents RIS 2.0 from launching correctly on newer versions of Windows then launches RIS 2.0
del "%TEMP%\Ris 2.0.mov.#res"
if %PROCESSOR_ARCHITECTURE% == x86 (
"%PROGRAMFILES%\LEGO MINDSTORMS\RIS 2.0\LaunchRis2.exe"
) else (
"%PROGRAMFILES(X86)%\LEGO MINDSTORMS\RIS 2.0\LaunchRis2.exe"
)
' Author: Keegan Witt
' Description: Launches the launchRis.bat batch script on the appropriate path (checks architecture information)
Set WshShell = WScript.CreateObject("WScript.Shell")
If Is64Bit = True Then
obj = WshShell.Run("""%PROGRAMFILES(X86)%\LEGO MINDSTORMS\launchRis.bat""", 0)
Else
obj = WshShell.Run("""%PROGRAMFILES%\LEGO MINDSTORMS\launchRis.bat""", 0)
End If
set WshShell = Nothing
Function Is64Bit()
Is64Bit = False
Dim colOS : Set colOS = GetObject("WinMGMTS://").ExecQuery("SELECT AddressWidth FROM Win32_Processor",, 48)
Dim objOS
For Each objOS In colOS
If objOS.AddressWidth = 64 Then Is64Bit = True
Next
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment