Folder managment 
Author Message
 Folder managment

Hi,
Before I start trying to do this could someone please let me know if it is
possible to perform the following using VBScript.

What I am trying to do is create a script that when double clicked by a user
will prompt for a project name (i.e. Client5-06-2003) which will then be
used to create a folder on a mapped drive along with a set of subfolders
containing a set of predifined templates.  The whole reason for the script
in to simplify the archive process on our network.

Any comments will be gladly recieved, but please be aware that if I can do
this it's going to be a bit of a learning curve for me.

Regards,



Tue, 06 Dec 2005 22:41:08 GMT  
 Folder managment
Sounds reasonable enough. You'd want to use the
FileSystemObject to do your dirty work. You create it using

Set objFSO = CreateObject("Scripting.FileSystemObject")

That gives you a handle to the user's file system,
including mapped network drives. You'd need to use
InputBox to get the name of the project.

strProjectName = InputBox("Enter name of project.")

If you want the folder that is created have the name of
the project to be entered, you'd use the following code
(which assumes the destination drive is S:) -

objFSO.CreateFolder "S:\" & strProjectName

To create any subfolders, you'd use the same theory:

objFSO.CreateFolder "S:\" & strProjectName & "\Subfolder1"
objFSO.CreateFolder "S:\" & strProjectName & "\Subfolder2"
etc...

I'm not sure what you mean by "templates" though.... Are
these files that already exist somewhere else and would be
compied to this new folder? If so, you could use something
like:

objFSO.CopyFile "C:/Templates/myTemplate.txt","S:\" &
strProjectName

Go to msdn.microsoft.com/library and do a search
on "FileSystemObject"...

Quote:
>-----Original Message-----
>Hi,
>Before I start trying to do this could someone please let
me know if it is
>possible to perform the following using vbscript.

>What I am trying to do is create a script that when

double clicked by a user
Quote:
>will prompt for a project name (i.e. Client5-06-2003)
which will then be
>used to create a folder on a mapped drive along with a
set of subfolders
>containing a set of predifined templates.  The whole

reason for the script
Quote:
>in to simplify the archive process on our network.

>Any comments will be gladly recieved, but please be aware
that if I can do
>this it's going to be a bit of a learning curve for me.

>Regards,

>.



Wed, 07 Dec 2005 04:24:30 GMT  
 Folder managment
This is certainly possible using the Scripting.FileSystem object and
its CreateFolder and CopyFolder methods. I would recommend looking at
something like the DevGuru vbscript pages online or buying "Windows
Script Host" by Tim Hill to get a good idea of what is possible with
VBS and the Scripting.Filesystem object.

Issues I think you will need to look at given the project you have
outlined are validating the name entered by the client for the folder
name and whether permissions will be a problem for any of the users.

Robert

Quote:

> Hi,
> Before I start trying to do this could someone please let me know if it is
> possible to perform the following using vbscript.

> What I am trying to do is create a script that when double clicked by a user
> will prompt for a project name (i.e. Client5-06-2003) which will then be
> used to create a folder on a mapped drive along with a set of subfolders
> containing a set of predifined templates.  The whole reason for the script
> in to simplify the archive process on our network.



Wed, 07 Dec 2005 04:47:20 GMT  
 Folder managment
Thanks for the advice guys.  I've managed to cobble something together that
works by trial and error, but I have no real idea how it works.  This little
project has opened my eyes to all the little time saving possibilities
scripting can offer so I'm off to amazon to get myself a book.

By my reckoning I should get at least an extra 2 hours down the pub a week.

Thanks  again


Quote:
> This is certainly possible using the Scripting.FileSystem object and
> its CreateFolder and CopyFolder methods. I would recommend looking at
> something like the DevGuru vbscript pages online or buying "Windows
> Script Host" by Tim Hill to get a good idea of what is possible with
> VBS and the Scripting.Filesystem object.

> Issues I think you will need to look at given the project you have
> outlined are validating the name entered by the client for the folder
> name and whether permissions will be a problem for any of the users.

> Robert




Quote:
> > Hi,
> > Before I start trying to do this could someone please let me know if it
is
> > possible to perform the following using vbscript.

> > What I am trying to do is create a script that when double clicked by a
user
> > will prompt for a project name (i.e. Client5-06-2003) which will then be
> > used to create a folder on a mapped drive along with a set of subfolders
> > containing a set of predifined templates.  The whole reason for the
script
> > in to simplify the archive process on our network.



Fri, 09 Dec 2005 04:11:16 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. List of methods that I can use during AD/Exchange user managment

2. Page managment in ASP

3. Larg HardDrivers Managment

4. IIS4 and WSH (WWW & FTP managment)

5. User managment in ADP Project

6. managment of Events

7. Win95 to Win98 any better memory managment

8. File Managment and Windows dir.

9. folder in a folder in a folder...

10. Build XML of folders, sub folders and files from specified folder

11. Determining if a folder is a local pst folder or a imap (server folder)

12. How to delete folders/files within a folder but not the folder itself

 

 
Powered by phpBB® Forum Software