stephenmbell
IS-IT--Management
I have a script.. among other things... it does the following:
----------------
'declare local variables
Dim objFSO, objFolder, strFolderPath, strNewFolderName, strCopyFolder
'initialize strings
strFolderPath = "C:\Program Files\Pinnacle\Oaswin"
strNewFolderName = "C:\Program Files\Pinnacle\Oaswin_Backup"
strCopyFolder = "D:\UPGRADES\OASISUPGRADE\Oaswin"
'create new fso
Set objFSO = CreateObject("Scripting.FileSystemObject")
'get the current oaswin folder
Set objFolder = objFSO.GetFolder(strFolderPath)
'move the current folder to the backup location
objFolder.move strNewFolderName
'Copy files from usb to hdd
Call CopyFolders(strCopyFolder, strFolderPath)
'perform cleanup
Set objFSO = Nothing
Set objFolder = Nothing
-------
inside my script, this is a procedure. When I run my script by double clicking on myscript.vbs (that includes above code) this operation completes fine.
in the grand scheme of things, this is 1 of about 3 scripts i need to run....from a batch file...
so - it goes like this
1. run d:\mybatch.bat
2. mybatch.bat runs d:\script1.vbs
3. script1.vbs calls d:\script2.vbs (which includes the above code)
4. script1.vbs calls c:\setup.exe
5. script1.vbs calls d:\script3.vbs
The problem I am having -- when I run this by doubleclicking on script2.vbs, the code runs fine - error free. when I run it by doubleclicking on d:\mybatch.bat, I get an error when trying to:
objFolder.Move strNewFolderName
(the copy folders is a procedure .. pass it 2 paths and it copies source to destination..)
The error I receive is Permission Denied. I know that I am working across different drives,
Any idea why???
Thanks in advance.
sb
----------------
'declare local variables
Dim objFSO, objFolder, strFolderPath, strNewFolderName, strCopyFolder
'initialize strings
strFolderPath = "C:\Program Files\Pinnacle\Oaswin"
strNewFolderName = "C:\Program Files\Pinnacle\Oaswin_Backup"
strCopyFolder = "D:\UPGRADES\OASISUPGRADE\Oaswin"
'create new fso
Set objFSO = CreateObject("Scripting.FileSystemObject")
'get the current oaswin folder
Set objFolder = objFSO.GetFolder(strFolderPath)
'move the current folder to the backup location
objFolder.move strNewFolderName
'Copy files from usb to hdd
Call CopyFolders(strCopyFolder, strFolderPath)
'perform cleanup
Set objFSO = Nothing
Set objFolder = Nothing
-------
inside my script, this is a procedure. When I run my script by double clicking on myscript.vbs (that includes above code) this operation completes fine.
in the grand scheme of things, this is 1 of about 3 scripts i need to run....from a batch file...
so - it goes like this
1. run d:\mybatch.bat
2. mybatch.bat runs d:\script1.vbs
3. script1.vbs calls d:\script2.vbs (which includes the above code)
4. script1.vbs calls c:\setup.exe
5. script1.vbs calls d:\script3.vbs
The problem I am having -- when I run this by doubleclicking on script2.vbs, the code runs fine - error free. when I run it by doubleclicking on d:\mybatch.bat, I get an error when trying to:
objFolder.Move strNewFolderName
(the copy folders is a procedure .. pass it 2 paths and it copies source to destination..)
The error I receive is Permission Denied. I know that I am working across different drives,
Any idea why???
Thanks in advance.
sb