| |
Batch File ExampleCreate a batch file. Open Notepad and copy the following text: @echo off cd /D "%PROGRAMFILES%\DAEMON Tools Pro" DTAgent.exe -add scsi if errorlevel 0 goto mount_image if errorlevel -1 goto error_add :error_add echo You couldn't add new virtual drive. Possible, you already have the maximum drives on your system. :mount_image DTAgent.exe -mount scsi, 1, "D:\Images\Games\Tortuga_game\Tortuga_game.mds" if errorlevel 0 goto get_letter if errorlevel -1 goto end :get_letter DTAgent.exe -get_letter scsi, 1 if errorlevel 0 goto exit_successfull if errorlevel -1 goto error_letter :end echo Image file not found goto exit :exit_successfull echo An image was seccessfully mounted to %errorlevel% letter (A-0, B-1, C-2 etc.) drive. goto exit :error_exit echo Image file not found or drive not added goto exit :error_letter echo Can't define drive letter :exit pause
@echo off will turn off all line echoes in the batch file script. Save the file with any name, anywhere. Make sure that you have assigned extension *.cmd or *.bat (because the Notepad will assign the default *.txt). Now run your file. If you have already used maximum number of SCSI virtual drive or exist any other reason why program can't add new SCSI drive, you will see the appropriate warning message. Otherwise new SCSI virtual drive will be added to your system and the program tries to mount it. If there is no found mounted image because you have pointed invalid path or name of image, you will see warning message and program will finish. If you have successfully mounted game images on the virtual drive, which is located on the D drive, the program returns the number of letter of the alphabet. If it returns value of 6, it is the letter G, because numbering starts with zero. Please note that the number of new drive is listed as 1, because when you install the program automatically adds a virtual drive that is set to 0, respectively. |
|
