With Win XP, I am using DOS Batch files (does anyone remember them?) to backup selected files. The batch file consists of one stm, xcopy c:foldernamefilename E:, where E: is my CD write drive. That works fine, the only problem is that the DOS window opens, the batch file executes, and then the DOS window closes so quickly I can’t read any messages. In Win 98, the property sheet for the batch file contained a check box that said “Close when finished”, and if I did not click that, the window stayed open. That check box is missing in Win XP. Is there any way to keep the window open?
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Batch Files (XP 1)
Home » Forums » AskWoody support » Windows » Windows Vista, XP and earlier » Questions: Vista, XP back to 3.1 » Batch Files (XP 1)
- This topic has 15 replies, 6 voices, and was last updated 22 years, 4 months ago.
AuthorTopicWSmickey11030
AskWoody LoungerDecember 4, 2002 at 11:22 pm #380308Viewing 1 reply threadAuthorReplies-
WSWyllyWylly
AskWoody Lounger -
WSmickey11030
AskWoody Lounger -
WSWyllyWylly
AskWoody Lounger -
WSkaplinb
AskWoody Lounger -
WSgemflip
AskWoody Lounger -
WSWyllyWylly
AskWoody LoungerDecember 6, 2002 at 7:39 am #636808The COMMAND prompt is in fact a 16-bit prompt andfollows a slightly different set of rules when processing commands. CMD is a 32-bit program not unlike many other programs that are designed to run under the Windows NT family of operating systems (of which XP is borne). The differences are mostly transparent but affect the way DOS based programs run. Most notably, the way memory is handled is different, but again, the differences are likely not to be noticed by a user, although some programs most certainly care!
-
WSTimOz
AskWoody LoungerJanuary 5, 2003 at 6:19 am #642394I’ve only recently switched from W98 to XP, and was using COMMAND via the run box, until a few days ago, when I accidentally clicked the Command Prompt shortcut in Accessories. I found it sufficiently different from COMMAND, to find out what was behind it, and discovered CMD (better late than never)!
Now I slap myself on the wrist if my fingers start typing “command”, before correcting it to “cmd”.
As you say, most of the differences between COMMAND and CMD are subtle, but curiosity got the better of me, and I fiddled around with both to see for myself. What I found is probably mainly of curiosity value, but here ’tis anyway:
COMMAND.COM, is a DOS program run under Windows. If started from the Run box, the window title is “C:WINDOWSSystem32command.com”, but double-click the file directly and the title is “MS-DOS Prompt”. Either way, if you run multiple instances (and group your taskbar buttons), they get lumped together as “NTVDM.EXE” (for, NT Virtual DOS Machine, maybe?). That probably explains why it’s so much slower than CMD, especially to start and end. Inside the program window, COMMAND uses short file names in the command prompt and identifies itself as:
Microsoft® Windows DOS
©Copyright Microsoft Corp 1990-2001.Ignoring short/long file name differences, and cosmetic upper/lowercase differences in the names, the following environment variables differ from CMD:
COMSPEC=C:WINDOWSSYSTEM32COMMAND.COM
TEMP=C:WINDOWSTEMP
TMP=C:WINDOWSTEMP
BLASTER=A220 I5 D1 P330 T3CMD.EXE is, as you say, a genuine Windows program, with a superset of COMMAND.COM functionality. If started from the Run box, the window title is “C:WINDOWSSystem32cmd.exe”, as it is if you double-click the file. The default shortcut, under Accessories, sets the title to “Command Prompt”. In any case, Multiple instances get lumped together as “Windows Command Processor”. Inside the program window, CMD uses long file names in the command prompt and identifies itself as:
Microsoft Windows XP [Version 5.1.2600]
© Copyright 1985-2001 Microsoft Corp.The following environment variables differ from COMMAND:
ComSpec=C:WINDOWSsystem32cmd.exe
TEMP=C:DOCUME~1useridLOCALS~1Temp
TMP=C:DOCUME~1useridLOCALS~1Temp
windir=C:WINDOWSI suspect the difference in the TEMP/TMP values has the potential to cause some sloppy programs to throw a wobbly. The default command buffer doesn’t seem to work for COMMAND, and it is noticeably slower than CMD. After all that, the only reason I can think of for the continued existence of COMMAND is that it may be needed for backward compatibility for some DOS programs.
A final curiousity: The “DOS” copyright is only from 1990, while “XP” goes all the way back to 1985? That little gleam in Bill’s eye must have been there for quite a while!
-
WSWyllyWylly
AskWoody LoungerJanuary 5, 2003 at 7:52 am #642395I think Bill’s gleam has been there all along.
I believe the differences in the TEMP directory settings are due to the implementation of roaming profiles in 2000 and XP. That’s what the Local Settings under Documents and Settings is for. If you run COMMAND.COM, since it’s not NT-aware in the way CMD is, it doesn’t play by the “roaming profiles” rules. Just a guess there. You can set runtime parameters for CMD va the autoexec.nt and config.nt files located in the System32 directory (folder, whatever). Your guess about NTVDM was correct….the NT Virtual Dos Machine.
You can also use keyboard shortcuts in CMD that you can’t in COMMAND. For example, left arrow key in CMD doesn’t delete typed characters, but it will in COMMAND. CTRL+Left and Right arrow keys will take you from command to command (much like ion Word) and doesn’t work in COMMAND. Most importantly, CMD is also the Windows XP (or 2000 or NT) command line interpreter, and understands more instructions, because it isn’t bound to 8.3 limitations as demonstrated by the short filenames it displays. That’s a 16-bit limitation at its finest. COMMAND is the MS-DOS interpreter, and the difference between is XP and DOS is, well, duh! Very noticeable.
If you’re curious, you can also type CMD /? at the run prompt and get extensive online documentation, with some runtime switches. And a final difference between the two interpreters that you may not have noticed…..if you click on the ‘X’ in the right hand corner of the window, CMD will simply exit whilst COMMAND will invoke a “Windows cannot end this task” box. If you’re curious, you can also type CMD /? at the run prompt and get extensive online documentation, with some runtime switches. The difference in options is striking. When I compared I noticed a command switch that would have solved the problem that started this thread: CMD /K would have executed the command and left the window open.
I thought I’d pass along a few tips for your arsenal regarding the CMD windows. I make frequent use of the F7 key, which will pop up a list of the commands in the buffer (anything you’ve entered). You can also increase the command buffer by modifying the PIF for your batch files (the icon properties). F2 will allow you to copy a line up to a certain character, and F4 will delete in the same manner. So, if you have a loooooong command line, you can delete up to say, character 15. Handy if you have a console only with no mouse.
Cheers!
-
WSTimOz
AskWoody Lounger -
WSbigaldoc
AskWoody LoungerJanuary 5, 2003 at 11:42 am #642412It’s like deja vu all over again, as Yogi would say, that you guys added to this thread when you did. I’ve been trying to find an answer to this since yesterday. I was doing some work in the CMD window and wanted to copy some text from the screen to the “clipboard.” I was certain that could be done, but can’t remember. Seems I even remember it’s called “MARK.’ Do either of you know where the answer is. I’ve looked in DOSKEY help.
-
WSTimOz
AskWoody LoungerJanuary 5, 2003 at 9:47 pm #642517You were so close that a mild expletive could be excused. There’s two ways, keyboard & mouse:
- ALT-SPACE, Edit, Mark – then arrow around to what you want to copy. Hold down SHIFT and arrow around again to highlight the block you want to copy. Press ENTER, and it’s on the clipboard. To paste it back in a CMD window use ALT-SPACE, Edit, Paste. Other apps is standard windows stuff.
- Mouse around to what you want to copy. Hold down the left button and drag around to highlight the block you want to copy. Right click, and it’s on the clipboard. To paste it back in a CMD window right click again. Other apps is standard win stuff.
For #2 you need QuickEdit Mode enabled, see my post 210683, above.
-
WSbigaldoc
AskWoody Lounger -
WSbigaldoc
AskWoody LoungerDecember 6, 2002 at 11:03 am #636824Mark, help me out here with remembering the name: The thing I like about using CMD, Gary, is that the “DOS” window you get already has the old program for recalling commands loaded. Jeez, I can’t remember it’s name even. But if you use, for starters, the UP arrow key, you can recall commands and/or edit them. As you can tell, that’s the only thing I ever use it for, but there’s also macros and stuff there too. CMD is GOOD!
[Edited FIVE mins. later!]
DOSKEY says I, but it just takes my old brain a few minutes longer than it used to! Sorry
-
WSTimOz
AskWoody LoungerJanuary 5, 2003 at 4:03 am #642377If you like the built-in DOSKEY functionality of CMD.EXE, here’s a few others you might like.
You can enable Automatic Completion of file & folder names, if you use start CMD with the /F parameter (ie. CMD /F). With this on you can type a command and part of a file name, then press CTRL-F to fill in the rest. Repeated CTRL-Fs cycle through available matches (within the current folder). If you don’t enter any characters to match, all names are cycled. To limit the auto complete to folders, you can use CTRL-D (could it be a ‘D” because folders used to be directories in the bad old days before politically correct Winspeak started to creep in?). You can make auto complete permanent for your PC, or on a per user basis, see KB 310530. (I haven’t bothered with this step, partly because the instructions for file & folder name completion seem to be a… about face.)
The Windows file associations are also supported. For example, if you type test.txt at the command prompt, the file is opened by Notepad, in a new window. Handy occasionally, especially with auto completion.
QuickEdit Mode allows you to mark, copy & paste text with the mouse, instead of the Edit menu. Not always useful in a command line environment where your fingers are hovering over the keyboard, but it has its moments. You can toggle QuickEdit in the properties for the window, the official method is in KB 282301.
Many of the old DOS commands & programs have become seriously more useful with each reincarnation of Windows. To dig deeper/wider, the Help command lists some commands you can get more help for (a subset deemed safe by Bill?). You can usually get help for unlisted commands (eg NET) if you use a “HELP”, “/?”, or “/HELP” command line parameter. I don’t know if there’s a list of these hidden commands floating around somewhere.
It’s almost a pity that batch files are hardly needed, now that all this functionality is available.
-
-
-
-
-
WSbigaldoc
AskWoody LoungerDecember 5, 2002 at 1:32 am #636440And, since it’s been mentioned many times here in The Lounge, if you want an alternative for the job of backing up selected files, check out Karen Kenworthy’s
file replicator.
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
2 hours, 58 minutes ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
3 hours, 24 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
14 hours, 19 minutes ago -
How much I spent on the Mac mini
by
Will Fastie
3 hours, 46 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
6 hours, 7 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
20 hours, 11 minutes ago -
Setting up Windows 11
by
Susan Bradley
3 hours, 47 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
15 hours, 39 minutes ago -
Powershell version?
by
CWBillow
16 hours, 32 minutes ago -
SendTom Toys
by
CWBillow
48 minutes ago -
Add shortcut to taskbar?
by
CWBillow
20 hours, 28 minutes ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
1 day, 12 hours ago -
How can I install Skype on Windows 7?
by
Help
1 day, 11 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
18 hours, 27 minutes ago -
We live in a simulation
by
Alex5723
2 days, 2 hours ago -
Netplwiz not working
by
RetiredGeek
1 day, 13 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
2 days, 15 hours ago -
Microsoft is killing Authenticator
by
Alex5723
1 day, 3 hours ago -
Downloads folder location
by
CWBillow
2 days, 21 hours ago -
Remove a User from Login screen
by
CWBillow
1 day, 17 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
2 days, 12 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
2 days, 12 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
15 hours, 6 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
2 days, 12 hours ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
1 day, 11 hours ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
3 days, 1 hour ago -
Multiple Partitions?
by
CWBillow
3 days, 2 hours ago -
World Passkey Day 2025
by
Alex5723
21 minutes ago -
Add serial device in Windows 11
by
Theodore Dawson
4 days, 11 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
2 days, 11 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.