December 3, 200520 yr Hi, can i copy a file from my windows xp cd(its an application) to (example:) c: directory?How can i do that?
December 3, 200520 yr Here is a VBS script that checks for the CD letter then copy the file to the new locationThis color is the CD file that you must file inThis color text is the location to where you copy to, you must fill it inSave As Copy.VBSConst OverwriteExisting = True Dim Act, CD, Fso, strCd '''' VARIBLES FOR THE SCRIPT Set Fso = CreateObject("Scripting.FileSystemObject") Set Act = CreateObject("Wscript.Shell") '''' VARIBLE AS A OBJECT Set CD = Fso.Drives For Each strCd In CD If strCd.DriveType = 4 Then '''' CHECKS FOR THE CD OR DVD DRIVE If Fso.FileExists(strCd & "\NAME_OF_FILE") Then '''' THIS CONFIRM IT CORRECT CD Act.Popup "This Is A XP CD",5,"Confirm XP CD", 0 + 32 Fso.CopyFile (strCd & "\NAME_OF_FILE") , ("THE_NEW_LOCATION_FOR_FILE" ), OverwriteExisting Else Act.Popup "This Is Not The Correct CD",5,"Incorrect CD", 0 + 32 End If End If Next Edited December 3, 200520 yr by gunsmokingman
December 10, 200520 yr You could use the following lines in a batch to detect the drive letter:for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\Win51 set CDROM=%%i:echo Found CD-Rom as drive %CDROM%
Create an account or sign in to comment