Possibly
If NOT EXIST X:\NUL
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am running Win7 Professional on an Acer M3970 which is fitted with a multi-format (XD/MicroSD/SD/CF/MSProDuo) memory card reader.
The card slots are assigned drive letters E: thru I:.
Over the years, I have written batch files to automate the process of moving photos and other files from the memory cards to the working directory on the hard drive.
This system has worked fine on WinXP (and its predecessors as far back as Win98), but causes an error message on Win7:
dialog box title: cmd.exe - No Disk
error message text: There is no disk in the drive. Please insert a disk into drive \Device\Harddisk1\DR1.
The batch file at the heart of the processing is as follows:
@echo off
call !gpecho "%0 starting with parameters %1 %2" b
if not exist %1%2\nul goto endit
move %1%2\*.* . >> !z-gp.log
:endit
%1 is the drive letter - it is possible that I might be downloading files from any of the card drives, and preceding batch files cycle through them all.
%2 is the folder on the card which contains the photos - it varies from camera to camera, so preceding batch files pass the relevant folder names.
!gpecho is another batch file that displays feedback from batch processing on screen, and writes it to a log file called !z-gp.log
As can be seen, the batch file tests for the presence of a folder on the card, and only attempts to move files from it if it is there.
What I need is a corresponding command that will test for the presence of a card in the drive, exiting gracefully if it is not there.
I have looked around this forum and elsewhere on the web for an answer, without success.
Can someone point me in the right direction, please.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Possibly
If NOT EXIST X:\NUL