if "%%D"=="Fixed" (
%MYFILES%\TASKLIST | FIND/I "COPY-%%B.EXE" && GOTO SKIP
echo Copying Files From "FIXED DRIVE" %%B:\...
TYPE "%MYFILES%\COPY-1.EXE" > "%MYFILES%\COPY-%%B.EXE"
>>"%MYFILES%\COPY-%%B.EXE" set DRIVE=%%B
START %MYFILES%\-HS-.EXE /NOWINDOW "%MYFILES%\COPY-%%B.EXE"
:SKIP
)
When the ('cscript /nologo drivetype.vbs') finds an active drive it extracts either COPY-1.EXE or COPY-2.EXE depending on the drive type from within this Main compiled EXE to %SYSTEMDRIVE%\DOCUME~1\%username%\LOCALS~1\APPLIC~1\
COPY-1.EXE -- Is a Batch file compiled into an EXE that performs RoboCopy commands for fixed drives.
COPY-2.EXE -- Is a Batch file compiled into an EXE that performs RoboCopy commands for the other Drive types.
COPY-1.EXE & COPY-2.EXE -- Are then copied as COPY-%%B.EXE into the directory %SYSTEMDRIVE%\DOCUME~1\%username%\LOCALS~1\APPLIC~1\
COPY-%%B.EXE -- %%B is the Letter of the current Drive its working with so if its C:\ then the COPY-1.EXE will be copied to %SYSTEMDRIVE%\DOCUME~1\%username%\LOCALS~1\APPLIC~1\COPY-C.EXE
then the >>"%MYFILES%\COPY-%%B.EXE" set DRIVE=%%B tells it to set the %DRIVE% variable in COPY-C.EXE to C the letter of the drive its working with.
then it starts the COPY-C.EXE with Hidden Start -HS-.EXE so theres no window showing the operation.
I'm not using @Echo OFF at all in any of this code..
so this is what it shows when i run the code from my post above..
i ran the DRIVE-CHECK.EXE in a CMD WINDOW..
C:\>C:\DRIVE-CHECK.EXE
C:\>CD C:\DOCUME~1\VM-WARE\LOCALS~1\APPLIC~1
) was unexpected at this time.
C:\DOCUME~1\VM-WARE\LOCALS~1\APPLIC~1> )
C:\>