Is there a “FORCMD” variable (like “DIRCMD”, “COPYCMD”, etc.)?

The dir command checks for a dircmd environment variable for default arugments to use. Likewise, the copy and move commands check copycmd. Is there a corresponding variable (by any name) for the for command or another way to specify default arguments for the for command?

Whenever I use the for command to parse a file (using the /f switch), I always (so far) use the "delims=" argument. This is annoying to type (especially when I forget it).

Is there a way to set default arguments for the for command? (I tested using a forcmd variable, but it did not work. If so, does it work in DOS as well as the Windows command-prompt?

1

1 Answer

No.

The Windows command prompt's for built-in doesn't support anything called "FORCMD". No environment variable will change its behavior. There is no way to specify its defaults.

cmd.exe is an enhancement of the true DOS's command.com - it supported "Command Extensions" which extended and modified the behavior of many commands, including all the extra stuff on for.

cmd.exe is a Win32 executable and will not work under true 16-bit native DOS. command.com, which will, does not support the cmd.exe extensions - and the same applies as the cmd.exe's for: no environment variable changes its behavior and there is no way to specify its defaults (not that it would be useful as the command.com for is much more limited)

Still available via 32-bit versions of Windows, at least up to XP, is the old macro utility doskey that was included starting at MS-DOS version 5 or 6 and kept at least til XP. Defining some macros may help you avoid a bit of extra typing.

10

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like