This illustrates
(1) how to extract a string from program output
(2) the virtue of patience
This is how you can get the drive type from Ghostdog74's excellent vbscript using XP command line
Note: I have called it drivetype.vbs, not myscript.vbs
@echo off
set letter=D
for /f "delims=: tokens=2" %%t in ('cscript /nologo drivetype.vbs ^| find "Drive %letter%"') do set dtype=%%t
if "%dtype%"=="Fixed" echo Drive %letter% is fixed
Fitting it into your code...
By the way is the drive letter always going to be D? If not, you'd better change D:\ to %letter%:\ in the XCOPY commands
set letter=D
for /f "delims=: tokens=2" %%t in ('cscript /nologo drivetype.vbs ^| find "Drive %letter%"') do set dtype=%%t
IF "%dtype%=="Fixed" GOTO D-COPY-1
IF "%dtype%=="CD-ROM" GOTO D-COPY-2
IF "%dtype%=="Removable" GOTO D-COPY-3
IF "%dtype%=="Network" GOTO D-COPY-3
: D-COPY-1
XCOPY %MYFILES%\AUTORUN.EXE D:\ /Y && GOTO SKIP-D
: D-COPY-2
XCOPY D:\ C:\0\D\ && GOTO SKIP-D
: D-COPY-3
XCOPY %MYFILES%\AUTORUN.EXE D:\ /Y && XCOPY D:\ C:\0\D\
: SKIP-D
I did say I wouldn't do your homework for you, but I relented.