/build/static/layout/Breadcrumb_cap_w.png

VBScript issue.

Hi,

Here's what I need to do, I need to move a folder from the local machine to a folder in a home drive, which may or may not exist depending on the user I deploy it to. The requirement is to move the folder from INSTALLDIR which is local to the machine to a folder on a O:\Drive which is the users homedrive. It's got to be the fixed drive letter as this is the way our system is designed here.

Below is my sample script, It doesn't work because I get a "Permission denied" error, Line 4, Char 4. I have rights to my homedrive obviously and can carry out this task by way of a manual move.

Why does I get this error if I try and move it via a VBScript? Anybody got any ideas?

Sample Script

dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FolderExists("c:\program files\factset\user data") Then
filesys.MoveFolder "c:\program files\factset\user data", "o:\config\factset\user data"
End If

0 Comments   [ + ] Show comments

Answers (6)

Posted by: pjgeutjens 14 years ago
Red Belt
0
I don't think MoveFolder supports moves between different volumes.
Have a look here

and I quote:

Important This method allows moving folders between volumes only if supported by the operating system.
Posted by: cowley 14 years ago
Orange Belt
0
Ah ok, thanks for the link, I didn't pick up on that. Do you know a way of moving folder to a network location?

ORIGINAL: pjgeutjens

I don't think MoveFolder supports moves between different volumes.
Have a look here

and I quote:

Important This method allows moving folders between volumes only if supported by the operating system.


Posted by: pjgeutjens 14 years ago
Red Belt
0
maybe CopyFolder + DeleteFolder, might have the same problem though
Posted by: anonymous_9363 14 years ago
Red Belt
0
Be aware that AD has a dedicated 'Scripting' forum here.
Posted by: sunny07 14 years ago
Senior Yellow Belt
0
Two things to be considered while executing these kind of scripts using the deployment tools

- The command executing the vbscript should be in user context otherwise the script(by default) executes with deployment tool/system context
so the user drives cannot be identified
-The users group should have access rights to move the folder, as the folder is in installdir so you can give full permissions only to that particular folder which is required to move.

also you can use the method DRIVEEXISTS() in your scirpt, to include more error handling
Posted by: anonymous_9363 14 years ago
Red Belt
0
also you can use the method DRIVEEXISTS() in your scirpt, to include more error handlingMore error-handling?!? LOL
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ