Jump to content

Copy a file from the cd to a specific map on the computer


Edwin1988

Recommended Posts


Here is a VBS script that checks for the CD letter then copy the file to the new location

This color is the CD file that you must file in

This color text is the location to where you copy to, you must fill it in

Save As Copy.VBS

Const 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 by gunsmokingman
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...