Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Need small help with folder creation and path

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,39569
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Need small help with folder creation and path
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Need small help with folder creation and path - 11/9/2006 2:41:48 AM   
  buffi

 

Posts: 87
Score: 0
Joined: 3/28/2005
From:
Status: offline
Hi All,
I have taken this script from here and need some help in modifing it.
I want the scrip to open an Input box and ask for the path and folder name.  If the folder does not exist on the entered path it should create the folder.
ex: the user will insert d:\test

Currently i have this on my script.


      
This doesnt work and i have no idea how to fix it :(

Thanks for the help.

buff
 
 
Post #: 1
 
 RE: Need small help with folder creation and path - 11/9/2006 3:07:43 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
strFolder = InputBox("Please Enter the path where you want to save your backup","Backup Path","")

IF strFolder = "" THEN
   Dim MsgPath
   MsgPath=MsgBox("Closing script - No Path was Entered",0, "Error!!!")
   WScript.Quit
Else
   SmartCreateFolder strFolder
End If

Sub SmartCreateFolder(strFolder)
    Dim oFSO:Set oFSO = CreateObject("Scripting.FileSystemObject")
    If oFSO.FolderExists(strFolder) Then
        Exit Sub
    Else
        SmartCreateFolder oFSO.GetParentFolderName(strFolder)
    End If
    oFSO.CreateFolder(strFolder)
    Set oFSO = Nothing    
End Sub

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to buffi)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Need small help with folder creation and path Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts