Name: Kardian Date: June 29, 2007 at 16:33:14 Pacific Subject: Copying files with a space OS: Windows XP Pro CPU/Ram: AMD Athlon XP 1900+, 512M
Comment:
Hello,
I'm working with DOS 6.22 and I need to copy a file named "H START.G" (without the quotes), but when I use the copy command, it says "Too many parameters". If I try to copy using H*.G or any other use of the wildcard, the system tries to copy the file as "HSTART.G" instead of "H START.G". As a result, it gives me a file not found error. I've even tried HSTART~1.G and that doesn't work either. Any ideas?
I created a file named H START.G and both 6.22 and 98 dos saw it as HSTART~1.G. So I don't know why it's not copying. But when you have it on the 6.22 system and you do a DIR for the directory it's in, how does it show the file? That should be the way to copy it.
If you have more than one file for which 8.3 format could give HSTART~1.G then it could be something like HSTART~2.G and so on.
Doing a dir shows the file as H START.G, and it is the only file with that sort of name. I'm working with Windows 3.11, so maybe that's why the file doesn't show up as HSTART~1.G?
os2fan2, I will try out your idea when I get back to work on Monday.
DOS will indeed show H START.G, if it is created by some OS that does not rely on VFAT. It will even show files like LPT1 and CON, if these happen to be in the directory.
It won't be able to work with them directly, though. To handle the first, use wildcards.
To handle the second, you could use a hacked version of command.com, which uses different devices. Things like LPT1 etc become standard files, which can be deleted.
The dream you dream alone is only a dream, The dream we dream together is reality.
I tried the methods used in the previous replies, but it didn't work. Even when using ? in place of the space, DOS still tries to copy the files as if they didn't have spaces.
As for the hacked version of command.com, I will see if I can find it. Thanks for all the replies!
A 9x bootdisk won't do it. Even 9x pure dos doesn't preserve the space, at least using its available internal commands. I have used NTFS4DOS to copy LFN correctly. I don't know about OS/2.
Technically, H START.G isn't an LFN if the space is an unseen character instead of a space. (But then the wildcard ? should have worked.)
Kardian, it'd be helpful to know how the file was created. Also, can you just use COPY *.* or COPY *.G? Even if that copies more files than you want, try it and post back what the copied files look like.
Oh, and I don't think your using win 3.11 makes any difference. On my 3.1 the file I created shows the same as with dos--HSTART~1.G.
The files were created by the DOS program I'm trying to transfer (from a DOS computer to a Win95 computer). Normally, I'd just slave the DOS computer's hard drive in the Windows 95 computer, but the DOS computer's hard drive uses a floppy drive cable instead of the standard IDE cable. Plugging the old hard drive into the Windows 95 computer's floppy controller didn't work.
I did try using COPY *.*, COPY *.G, COPY HSTART~1.G, and COPY H?START.G, but no matter what command I use, it tries to copy the file as HSTART.G and gives a file not found error.
The file appears to be a critical part of the program, as the program won't function correctly without it.
it tells how to add a space to a file name using the ASCII 255 character. Maybe that's what your software did.
Try this: With numlock on type COPY H then hold the ALT key down and type 255 on the keypad. The dos icon should move one space. Type in the rest of the file name, START.G. It should show as COPY H START.G--exactly the same as if you used a regular space but dos will see it differently. Then finish the line with the destination of where you want to copy the file.
Ascii 32 is also a space but it's used as a control character. I don't know if that makes a difference. You can experiment with the various ascii codes and see if any others result in a blank space. Also, take a close look at the 'space'. Is it possible there's a barely legible character there--maybe ascii 250?
It seems obvious that dos isn't seeing the space as a regular space so maybe this will work.
I created a file with ascii 255 instead of the space and dos did see it as H START.G instead of HSTART~1.G so it's getting close. But I had no problems copying it using any wildcard scenario.
Kardian, does the file by chance have a hidden or system attribute?
I frequently create filenames with spaces (and other things) in pure DOS. There are a number of ways to do this, including tricks with PKZIP, QBASIC, and with Win 9x's native DOS commands. I'll give you one of the easiest methods. But first, check DAVEINCAPS' suggestion above regarding file attributes (this is too often overlooked) and remove them if necessary. Then do the following:
1. Get PKZIP for DOS if you don't already have it. Version 2.04 is common and sufficient for this task, but 2.50 is even better. (Google PKZIP250.EXE).
2. On the DOS machine, PKZIP temp.zip h?start.* (just in case it's really h start. g). If it's the only file, then PKZIP temp.zip *.* will suffice instead.
3. Copy the temp.zip onto your Win95 machine by the method of your choice.
4. Boot the Win95 machine in pure DOS mode and PKUNZIP temp.zip in the directory where it belongs.
5. DOS will see the file name exactly as it was before, spaces and all. Change file attributes back if necessary. Even Windows will see the 8.3 name with spaces and no tildes.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE