Jump to content

Recommended Posts

Posted

I have a basic question about MS-DOS batchfile: syntaxis of COPYCMD.

Should I use:

SET COPYCMD=/Y,V

or 

SET COPYCMD=/Y,/V

or is there no difference and can I use both?

BTW internet search gives no results in this case (for me).

 


Posted

Gemini indicates that both do the same thing under MS-DOS as you specified. It also states that the extra . in /Y./V is ignored by both command.com and cmd.exe interpreters.

These should also be the same:
SET COPYCMD=/Y/V
SET COPYCMD=/Y /V

Gemini does not know whether there are specific versions of MS-DOS where specific usage of delimiters matter.

Of course, you are best to test both commands in a real world scenario before implementing them in your batch file, since LLMs can't/don't do any sort of testing and you have a greater ability to detect if there is actually a difference or not.

Posted (edited)

Thanks a lot.

Testing is a bit difficult. I thought I could try with reversed order, for instance:

SET COPYCMD=/V,Y

but this is not taken, /Y must come first, like in the COPY-syntaxis.

No idea how I can test the V-part. I use it just for safety, because I have to copy files on a USB Flash drive in legacy mode.

Edited by deomsh
Posted

It seems /V is silent and you'd only know that it is being used if verification fails. Of course there is certainly a way to test that, but I only have theory on that process and not any actual instructions. How I'd imagine that would have to be done is you would need to attach/use a debugger or other process manipulation tool, halt the copy process at some point and you'd need to manually change something. Not knowing exactly how the copy command works, I don't know if you could simply edit the source file or if you'd have to change something in memory, before resuming the process. Another thing that you'd probably need to figure out is how the command is actually verifying. Does it do a CRC check or a bit compare? You'd also want to know at which points in the process that copy gets the info from the source and destination file occurs, so that you would have a better idea of when to interject to cause a failure. 

Your ability to cause a verification to reliably fail may be very difficult to do under DOS.

Posted (edited)

Using a debugger is a bit above my level, but thanks for your suggestions.

I did some tests with a stopwatch to see if there is a big difference in copyspeed, simply using COPY without '/V' and with '/V' on the command-line, but no conclusive results so far.

To be (more) sure about the placement of /V and /Y in SET COPYCMD I tried your (Gemini's) earlier suggestions too in Virtual Box, and it seems '/Y' must always come first. See following print-screens (Dutch MS-DOS 7.1):

TestingSETCOPYCMDwithargumentsYandVI.png.8aa61d4e54c6bcc2eaadac41bcf2b1f4.png

TestingSETCOPYCMDwithargumentsYandVII.png.d95243d353a6e198d4f85b23266902f8.png

TestingSETCOPYCMDwithargumentsYandVIII.png.a20504bd1acdb4595a712c6031160bbe.png

I looked in some of my MS-DOS' books, for instance 'Technical Reference MS-DOS 6.2' mentions only 'SET COPYCMD=/Y' (or /-Y).

 

Edited by deomsh
Posted

Even on an old computer, I doubt you'd see a measurable speed difference in copy speed with what you are using. Gemini says that /v was added in MS-DOS 3.2 but doesn't give a reference link. But let's say that is the case, the reason for needing to add /v was likely to handle copying issues on floppy disks. You would be more likely to see a speed difference on a 286 and copying to/from actual floppy disks.

In regards to /V/Y arrangement, this could be an issue with MS-DOS 7.1. While outside of your scope, you could see how other (actual) versions of MS-DOS handle this. COMMAND.COM should parse the entire command, read the options and then execute the command. If it does it in a FIFO method, it could be that (for some reason) it actually is totally ignoring the /Y or would (somehow) try to set that option after verification, and it shows you the overwrite prompt because of that. That is just a guess, but I wonder if DOS 5 or 6.22 has this issue.

You could also see if it behaves the same way without setting the COPYCMD variable, just run COPY /V/Y manually to see if it has the same result. If it doesn't then obviously it has something to do with the environment variable.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...