Edwin1988 Posted December 3, 2005 Share Posted December 3, 2005 Hi, can i copy a file from my windows xp cd(its an application) to (example:) c: directory?How can i do that? Link to comment Share on other sites More sharing options...
gunsmokingman Posted December 3, 2005 Share Posted December 3, 2005 (edited) 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, 2005 by gunsmokingman Link to comment Share on other sites More sharing options...
Doc Symbiosis Posted December 10, 2005 Share Posted December 10, 2005 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% Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now