Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: create a folder with subfolders

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: create a folder with subfolders
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: create a folder with subfolders - 4/3/2008 7:57:47 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Think about what your code is doing. Go through it one line at a time and understand exactly what that line does. Write down all of your variables on a piece of paper if you have to and go through the code one line at a time changing their values on the piece of paper to match what the code is doing. Until you understand what the code is doing to and with the variables that you are using, there is no way for you to learn this or any other language.

_____________________________

"... 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 ebgreen)
 
 
Post #: 21
 
 RE: create a folder with subfolders - 4/3/2008 4:56:42 PM   
  lazydev

 

Posts: 21
Score: 0
Joined: 2/21/2008
Status: offline
Thanks EbGreen and ehvbs
My task is completed .

Finally I want to know 

I have given strroot as D:\Archive\Active 
can we make it as in linux structure /D/Archive/Active 
when i changed to /  i get bad file name.

Just suggest me wether we can change it or not. 

(in reply to ebgreen)
 
 
Post #: 22
 
 RE: create a folder with subfolders - 4/3/2008 5:01:32 PM   
  ehvbs

 

Posts: 2065
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi lazydev,

no, you can't. VBScript runs under Windows only, so you can't access the native
linux file system. If you map a Windows drive to a linux folder (Samba), you can
use Windows names/syntax.

Regards

ehvbs

(in reply to ebgreen)
 
 
Post #: 23
 
 RE: create a folder with subfolders - 4/3/2008 8:27:11 PM   
  lazydev

 

Posts: 21
Score: 0
Joined: 2/21/2008
Status: offline
hi ehvbs
how Do you Do
yesterday you have made my Day as great Day

One exception Is still there In the program

If we pass no value at the foldername The subfolders are being created In the root .
how To elminate this exception.If no values are passed at the input Then the program should End .it should not create subfolders

Dim objFSO   : Set objFSO = CreateObject( "Scripting.FileSystemObject" )
Dim strRoot  : strRoot    = "D:\Archive\Active"
Dim aFolders : aFolders   =  Array( "InBound", "OutBound", "997", "Enrollment","Test" )
Dim strUInp  : strUInp    = InputBox("Please Enter a FolderName.")

Dim sFolder  : sFolder    = strRoot & "\" & strUInp
If objFSO.FolderExists( sFolder ) Then
WScript.Echo "Folder '" & sFolder & "' already exists"
Else
objFSO.CreateFolder sFolder ' easier than Subfolder.Add
End If
Dim oSubF    : Set oSubF  = objFSO.GetFolder( sFolder ).SubFolders
Dim sSubF
For Each sSubF In aFolders
  If objFSO.FolderExists( sFolder & "\" & sSubF ) Then
     WScript.Echo "Folder '" & sSubF & "' already exists"
  Else
     oSubF.Add sSubF
  End If
Next

have a great Day too

(in reply to ehvbs)
 
 
Post #: 24
 
 RE: create a folder with subfolders - 4/4/2008 12:01:30 AM   
  ehvbs

 

Posts: 2065
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi lazydev,

have a look at this:


      

Good luck!

ehvbs

(in reply to lazydev)
 
 
Post #: 25
 
 
Page:  <<   < prev  1 [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 >> RE: create a folder with subfolders Page: <<   < prev  1 [2]
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