• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Modify Batch file (HELP)

bbarnes

Senior member
I have a looping batch file as such:

Echo off
:Start
Echo Insert Disk
pause
Copy /V C:\NWW2000\*.* A:
goto Start

How can I make it do a full format on the floppy disk before copying?

TIA
 
I forget how to do it in a single batch file, but try calling another batch file with the Formatting part.
"CALL FORMAT.BAT" would work.
Also, put an "@" in front of "ECHO OFF" to get rid of that pesky command showing up whenever it's run. 🙂
 
Wait, do this:
Create a text file containing the letter "Y" (no quotation marks) and a carriage return (empty new line)
close the textfile and name it "input.txt"

Assuming that the file "input.txt" is included in the same folder/directory as the batch file, place this command in the batch program:

FORMAT A:<input.txt

That should do it, testing now...
 
I tried it this way, it worked like a charm.

Contents of batch program:
@ECHO OFF
FORMAT A:<input.txt
(blank line)
(end of file)

Contents of input.txt:
Y
(blank line)
(end of file)

If you want to hide the formatting information, try:
@ECHO OFF
ECHO Formatting floppy disk...
FORMAT A:<input.txt>nul
(blank line)
(end of file)

Keep in mind that if there are errors, the user may not see the message.
"Disk not found, abort retry ignore?"
The user will not see the error message or flashing cursor, and will not know what to press to continue. It will appear to have locked up.
I recommend allowing the format information to display on the screen.
 
Maybe this is a little clearer:

Contents of batch file:
------------------------------------
@Echo off
:Start
Echo Insert Disk
pause
format a:<input.txt
pause
Copy /V C:\NWW2000\*.* A:
goto Start

------------------------------------

Contents of input.txt:
------------------------------------
Y

------------------------------------

DON'T include the dashed lines.
Make sure you include the blank line at the end of input.txt
Now make sure you keep input.txt in the same folder as the batch file.
When you run the batch file, it should be able to format the floppy disk. It will automatically choose 'Y' when the format program asks "Are you sure [Y/N]?"
 
Back
Top