| 1. |
Solve : suppress an error message..??? |
|
Answer» if there is no disk in dir a:\ and i do "start a:" in cmd-batch, is there anyway to suppress the "Windows - No Disk" Error message that pops up..??Code: [Select]if exist a:\ start a:didn't WORK... yes the message did not show with dir a: 2>nul Have you tried it? if a formatted floppy is in the drive then a: exists then dir a: will work the output goes to nul so you don't see it and the && test is passed and the type "C:\1.txt" will happen. (unless the floppy has the write protect switch in the protect position) if a: does not exist then dir a: will not work and the && test is failed and the type C:\1.txt will not happen Maybe you don't know what && means? And why don't you answer about why you are using TYPE instead of COPY? yes i tried it.. like i said though if there are no files or folders in A:\ Dir A: will fail i tried on my usb drive E: your code dir E:>nul 2>nul && TYPE "C:\1.TXT" > "E:\1.TXT" there were no files or folders on the drive so Dir E: failed and so did the rest of the code.. i use TYPE instead of COPY becuz i don't want to use any external copy.exe like i say earlier... is there anyway to use this >nul FEATURE in this code "If Exist A:\ TYPE "C:\1.TXT" > "A:\1.TXT"Quote from: gumbaz on October 13, 2008, 01:17:58 PM i use TYPE instead of COPY becuz i don't want to use any external copy.exe There is no copy.exe in Windows. Where did you get that idea? Copy is an internal command just as type is. Quote like i say earlier... Try this XCOPY A:\Is_Ready.Test > NUL IF NOT ERRORLEVEL 4 ECHO Drive is ready. |
|