Thread: JL_Cmder
View Single Post
Old 04-24-2009, 12:07 PM   #423 (permalink)
cfg
Knows Where the Search Button Is
 
Join Date: Mar 2006
Model: 9x30
Carrier: VZW
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Fix for choice.com errors on Vista

I forget if this was an issue on Vista x86, but on Vista x64 choice.com chokes and dies. Instead you should use choice.exe which is found in %windir%\system32\choice.exe.

I keep jl_cmder in a common bin directory on Dropbox (referral link), so I need it to work transparently on multiple versions of Windows. To accomplish this I modified jl_cmder.cmd as follows:

Before:
Code:
@ECHO OFF
CLS
MODE CON: COLS=47 LINES=42
SET TITLE=JL_Cmder
SET VERSION=1.9.1
SET AUTHOR=Doug Fisher
SET MODIFY_LAST=10/10/2008
After:
Code:
@ECHO OFF
REM BEGINNING OF CHANGES
SETLOCAL
IF EXIST %windir%\system32\choice.exe (
		SET CHOICE=%windir%\system32\choice.exe
	) ELSE (
		SET CHOICE=%~d0%~p0choice.com
	)
)
REM END OF CHANGES
CLS
MODE CON: COLS=47 LINES=42
SETLOCAL - Don't clutter environment variables
IF EXIST ... - Check and see if choice.exe exists, if so, use it. If not use choice.com from the same directory as jl_cmder.cmd.

In the rest of the file you want to replace CHOICE WITH %CHOICE%. A modified jl_cmder.cmd is also attached (remove the .txt extension)
Attached Files
File Type: txt JL_Cmder.cmd.txt (24.0 KB, 40 views)
Offline   Reply With Quote