+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, VB Script to create folders in Coding and Web Development; Hi The following works fine - we run it through GPO at logon: ParentFolder = "H:\" set objShell = CreateObject("Shell.Application") ...
  1. #1

    Join Date
    Jun 2006
    Location
    Manchester
    Posts
    58
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    VB Script to create folders

    Hi
    The following works fine - we run it through GPO at logon:

    ParentFolder = "H:\"
    set objShell = CreateObject("Shell.Application")
    set objFolder = objShell.NameSpace(ParentFolder)
    objFolder.NewFolder "Year 1"

    to create folder 'Year 1' in the root of the users home area. What we would like to do is create a Year 1, Year 2, Year 3 etc folder in every home area so there is better file management as users move up the school. Other than using 6 scripts any ideas how to extend this script so it can add more than one folder?
    Many thanks

  2. #2

    Join Date
    Jul 2005
    Location
    Rugby
    Posts
    432
    Thank Post
    17
    Thanked 66 Times in 61 Posts
    Rep Power
    36

    Re: VB Script to create folders

    Just repeat the last line and substitute "Year 1" for whatever folder name.

    matt

  3. #3

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: VB Script to create folders

    Or use a For loop.

    For N = 1 to 7
    objFolder.NewFolder "Year "+CStr(N)
    Next



SHARE:
+ Post New Thread

Similar Threads

  1. Script to create a VPN connection
    By Norphy in forum Scripts
    Replies: 5
    Last Post: 20th April 2010, 12:37 PM
  2. Replies: 13
    Last Post: 8th November 2007, 03:53 PM
  3. Replies: 0
    Last Post: 17th February 2007, 05:43 PM
  4. Script to Create My Documents Subject Folders
    By SwedishChef in forum Scripts
    Replies: 15
    Last Post: 5th July 2006, 09:14 AM
  5. Script to create a local user on a XP box.
    By tosca925 in forum Scripts
    Replies: 3
    Last Post: 12th October 2005, 01:04 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •