webdott
asked on
vbs , vbscript to create new folder and copy contents in it
i need a vbscript that will do the following:
create a new folder in C:\FILES
allow me to name the new folder with a popup box
then copy directory, subdirectories, and files into that new folder from C:\BlankForms\
thanks
create a new folder in C:\FILES
allow me to name the new folder with a popup box
then copy directory, subdirectories, and files into that new folder from C:\BlankForms\
thanks
ASKER
something like this with the copy?
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
client = "C:\client"
copy = "c:\forms"
If Not objFSO.FolderExists(client) Then
objFSO.CreateFolder (client)
objFSO.CopyFolder (copy) (client)
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that is it except it does not copy over the folders or files from c:\blankforms
ASKER
thanks - i figured it out with your script.
it should be like this:
it should be like this:
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
client = "C:\files\" + InputBox("instructions", "popup title", "prefill in box")
If Not objFSO.FolderExists(client) Then
objFSO.CreateFolder (client)
objFSO.CopyFolder "c:\blankforms",(client)
End If
ASKER
I've requested that this question be closed as follows:
Accepted answer: 500 points for X_layer's comment http:/Q_27313994.html#36555680
Assisted answer: 0 points for webdott's comment http:/Q_27313994.html#36555706
for the following reason:
thanks for all your help!
Accepted answer: 500 points for X_layer's comment http:/Q_27313994.html#36555680
Assisted answer: 0 points for webdott's comment http:/Q_27313994.html#36555706
for the following reason:
thanks for all your help!
if the script will do nothing other than that, then it is better to use .cmd and use traditional commands md, xcopy
ASKER
does .cmd or .bat create popup boxes and do the same as above?
thanks
thanks
there is something similler
@set /p CopyToF=Please Enter Destination Folder?
this will prompt the user and put the value in CopyToF env. variable which you can use it in your cmd
@set /p CopyToF=Please Enter Destination Folder?
this will prompt the user and put the value in CopyToF env. variable which you can use it in your cmd
ASKER
so how would that be written in the .cmd / .bat
thanks
thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
both are good - i like the vbs popup box better, but bat/cmd is also good.
thanks to both of you
thanks to both of you
ASKER
i now need it to popup so that i can rename it
and copy files from one folder into this one that is created
Open in new window