Home / Microsoft / Microsoft DOS / how to check if a Drive is Fixed or Removable or a CD-DVD drive..???
0 Members and 3 Guests are viewing this topic. « previous next »
Pages: 1 2 3 [4]  All - (Bottom) Print
Author Topic: how to check if a Drive is Fixed or Removable or a CD-DVD drive..???  (Read 9360 times)
gumbaz
Topic Starter
Intermediate



Posts: 185


« Reply #45 on: September 10, 2007, 04:45:07 PM »

Code: [Select]
   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..
Code: [Select]

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:\>
IP logged
contrex
Guest
« Reply #46 on: September 10, 2007, 11:37:16 PM »

I hate these batch compilers. What happens if you just run the batch file without compiling it? Does it work then?
IP logged
Pages: 1 2 3 [4]  All - (Top) Print 
Home / Microsoft / Microsoft DOS / how to check if a Drive is Fixed or Removable or a CD-DVD drive..??? « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.067 seconds with 19 queries.