BACKGROUND
I have an existing CMD script that works fine. It launches an app from PROGRAM FILES like so
"%PROGRAMFILES%\MyApp\app.exe"
PROBLEM
- it works fine on 32-bit versions of Windows (Vista, Windows 7)
- but on 64-bit versions of Windows the app will be installed into "Program Files (x86)" and not "Program Files" (which is what happens on the 32bit OS)
WHAT I AM LOOKING FOR
- A script that robustly handles both cases (i.e. it "does the right thing" depending on the OS it is on)
- a method that uses only those features found in CMD.EXE. I Am curious about solutions that use Powershell, etc, but those don't help me - Powershell will not be on the machines this script will run.