|
Answer» Greetings.
As usual, one of the most useful, ever, commands - the step-thru-command-in-a-batchfile, "command/y/c" (just like the "deltree" command) hasn't been carried over into Win XP Pro (SP2) ENVIRONMENT.
I understand that the function can be simulated via the SET command - but I never got the detail and I'm quite unclear on the concept anyhow.
Could anyone please elaborate on this. I've had some batchfile execution problems and would like to avoid entering "pause" after each and every command (even then, the error message is, also as usual, often to cryptic or illogical to follow thru on).
Am new here and just hoping there are some DOS GURUS left in the world...
Thanx,
JT...Hi, JT. I miss the "command /y /k" myself. I just did a search, and I found this: http://www.geocities.com/rick_lively/MANUALS/COMMANDS/C/CMD.HTM which provides a batch file to replace the functionality. I haven't tried it myself, and it seems like it can be done with a lot less code ... but the guy seems to know how to write some good batch code so maybe that is the best way.
If that doesn't work let me know and I'll SEE what I can do to help.
Batch code from Rick Lively referenced above: Code: [Select]@ECHO OFF :: uses rlCmd.bat, %%rlCmd%%, :rlCmdY :: 2004Jan31 Rick Lively :: 2004Feb03 add comspec option :: IF EXIST rlCmd.bat GOTO :rlCmd10 IF /%1==/ GOTO :rlCmd30 IF EXIST %1.bat ( CALL %0 %1.bat GOTO :EOF ) IF EXIST %1.cmd ( CALL %0 %1.cmd GOTO :EOF ) IF NOT EXIST %1 GOTO :rlCmd20
SET rlCmd= ECHO @ECHO OFF>rlCmd.bat FOR /F "tokens=* " %%F IN (%1) DO ( ECHO CALL %0 %%F>>rlCmd.bat ECHO %%rlCmd%% GOTO :rlCmdY>>rlCmd.bat ECHO %%F>>rlCmd.bat ECHO :rlCmdY>>rlCmd.bat ) CALL rlCmd.bat ERASE rlCmd.bat SET rlCmd= GOTO :EOF
:rlCmd10 SET rlCmd=y SET /P rlCmd=%time% %* [Yncq]? IF /%rlCmd%==/C SET rlCmd=c IF /%rlCmd%==/c ( %COMSPEC% /K PROMPT=$T $P$_rlCmdY$G GOTO :rlCmd10 ) IF /%rlCmd%==/Y SET rlCmd=y IF /%rlCmd%==/Q SET rlCmd=q IF NOT /%rlCmd%==/y IF NOT /%rlCmd%==/q ( IF NOT /%rlCmd%==/N IF NOT /%rlCmd%==/n GOTO :rlCmd10 SET rlCmd= ) IF /%rlCmd%==/y SET rlCmd=:: IF /%rlCmd%==/q SET rlCmd=GOTO :EOF GOTO :EOF
:rlCmd20 ECHO. ECHO file '%1' '%1.bat' '%1.cmd' NOT found :rlCmd30 ECHO. ECHO To step through (2K or XP) NT batch file: Test ECHO prompts: [Yncq] Yes, No, Comspec, Quit ECHO. ECHO %0 Test ECHO OR %0 Test.bat ECHO OR %0 Test.cmd GOTO :EOF Oh ... and for DELTREE, you can use the Windows XP "RD" command. For example: rd /s /q "c:\documents and settings\user\local settings\temp\"A double thanx for all that, GG. Get onto it SOON as I finish my browse quota here; but I'm confused already. Guess I'll have to check that link first.
As you imply, seems to me there must be an easier way.
For instance (but at the risk of putting my foot in my mouth again), remember in the old days it said in DOS Help somewhere something about creating your own DOS Interpreter - like maybe via command/k, or something like that (to do w/ shell?).
I do have some old DOS (maybe 3.3, 5, 6, 7) command.com's tucked away somewhere. If one could drop out to command line and somehow get that to recognize one of the old command.com's in my DOS directory... if you see what I'm getting at.
One thing just occurred to me (and which I musst try), what if I created a boot disk (somehow) with, let's say, my old DOS 6 and then booted with that and ran my batchfile at the C:>\ prompt with command/y/k? But even if that worked, it wouldn't tell me why my batch file won't run properly under XP, now, would it. Back to square 1 ...
Not to worry. I'll check that link shortly.
(never knew about that XP deltree command either).
Jed...
|