vendredi 11 juillet 2014

Some help with batch files please

I have this very useful batchfile (useful to me any way)




Quote:








@ECHO OFF

color 70

ECHO.

ECHO ------------------------------------------------

ECHO - EXTRACT SELECTED FILES TO NORITSU HOTFOLDER -

ECHO ------------------------------------------------

ECHO.

ECHO.





REM INPUT JOB DETAILS





set /p jobid=- JOB NAME:







mkdir R:\%jobid%



set newpath= R:\%jobid%



:again

if {%1}=={} goto :EOF

copy %1 %newpath%

shift

goto again



Echo on



What this does is to allow me to select a number of files (in my case, images to be printed) in any folder, CD/DVD, memory card, smartphone, or thumb drive, input a job name (usually the customer's name) and the batch file will create a folder called job name at the remote location specified in the batchfile (in this case network "R:" drive), and copy the files into that folder.



This works fine except that the very first time in each day that I try to use it, it does not work, and it won't work until I physically go into My Computer and double click on R: drive.



I have a shortcut to "R:" drive on my desktop, and even clicking on that (the drive folder does open) is not enough. I have to open the drive in My Computer.



PS: I have noticed that when I first go into My Computer, R: drive is listed in the "type" column as a "Disconnected Network Drive". Even after I use a shortcut to navigate there. Once I click on R: drive in My Computer, the type changes to Network Drive. I presume this is what the problem is.



Can anyone suggest a workaround for this?



Is there a batch command that will connect a disconnected network drive?




Aucun commentaire:

Enregistrer un commentaire