Need to pass a variable to an external vbscript to manipulate files
Posted on 2005-03-07
Okay so I am having a senior moment. I need to pass a value to a vbscript so that the script can use the value to rename copied files. I have the following line of code that copies a set of default folders and files -->
Call Shell("cmd /c cscript \\Level1\Level2\Folder1\CopyFolders.vbs")
I have the following code in CopyFolders.vbs
Set objFSO = CreateObject("Scripting.FileSystemObject")
'First we need to create the new project folder
'Next we are going to copy the contents of the default folder into the new project folder.
objFSO.CopyFolder "\\Level1\Level2\Folder1\Folder2\Default", "\\Level1\Level2\Folder1\NewProject"
Now what I need for someone with more sense that I can muster at this point, is to tell me what to write so that I can pass a variable value into the "NewProject" value in the create folder line. Then what do I need to add to the Call Shell ... line to pass that value. Basically, what I am trying to do in a nutshell --> A user creates a new project record in a visual basic program, then on successful save of that record the vbscript file is executed to create the mandatory folders and files required for that project. I need the vbscript to name the new project file (new destination file) the Project's acronym that is received from the saved record (or more easily a text box on a form) and then copy the default subfolders and files to that newly renamed folder.
I need an answer as soon as possible, because we are wanting to deploy tomorrow, if I can resolve this issue. So to those that will help me or answer this question I say THANK YOU and I bow to your superiority! :)