Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Create multiple folders

Hi, how can I create folders having a .txt file as source?

thanks

Comments

  • LundinLundin Member Posts: 3,711
    [b][red]This message was edited by Lundin at 2007-2-5 5:27:17[/red][/b][hr]
    : Hi, how can I create folders having a .txt file as source?
    :
    : thanks
    :

    Not sure what you mean... open the .txt file, read whatever contents you need to form a filename, then call CreateDirectory()?


  • NesteaNestea Member Posts: 3
    [b][red]This message was edited by Nestea at 2007-2-9 18:19:39[/red][/b][hr]
    [b][red]This message was edited by Nestea at 2007-2-9 18:8:30[/red][/b][hr]
    yeaaa, for expample
    <1.txt>:
    FolderHome
    Blockbuster
    Scary
    Razor

    Well okay here I could use but what if I need 50 folders?
    I have tried it with VBScript but till now I have not figured it out.

    [b]CreateDirectory()[/b]
    Where would I use this?

    k I forgot the .. createfolder .. string

    dim filesys, rootfolder, newfolder
    rootfolder1 = "C:1"
    rootfolder2 = "C:2"
    set filesys = CreateObject("Scripting.FileSystemObject")
    Set newfolder = filesys.CreateFolder(rootfolder1)
    Set newfolder = filesys.CreateFolder(rootfolder2)

    Does every "rootfolder" need a "set newfolder"?
    Can I not just separate them by some character?
  • LundinLundin Member Posts: 3,711
    : [b][red]This message was edited by Nestea at 2007-2-9 18:19:39[/red][/b][hr]
    : [b][red]This message was edited by Nestea at 2007-2-9 18:8:30[/red][/b][hr]
    : yeaaa, for expample
    : <1.txt>:
    : FolderHome
    : Blockbuster
    : Scary
    : Razor
    :
    : Well okay here I could use but what if I need 50 folders?
    : I have tried it with VBScript but till now I have not figured it out.
    :
    : [b]CreateDirectory()[/b]
    : Where would I use this?
    :
    : k I forgot the .. createfolder .. string
    :
    : dim filesys, rootfolder, newfolder
    : rootfolder1 = "C:1"
    : rootfolder2 = "C:2"
    : set filesys = CreateObject("Scripting.FileSystemObject")
    : Set newfolder = filesys.CreateFolder(rootfolder1)
    : Set newfolder = filesys.CreateFolder(rootfolder2)
    :
    : Does every "rootfolder" need a "set newfolder"?
    : Can I not just separate them by some character?
    :


    It is still not clear what you want to do. In the first post you said that you want to create folders. From this post it seems that you wish to do something else as well, it is not clear what. If you told us what you wish to achieve, then perhaps we would be able to help.

    CreateDirectory() is a Win API function. Since you are using VB, you must import it from kernel32.dll and then hope and pray that the parameters aren't pointers or other things that aren't supported by the VB language.
  • NesteaNestea Member Posts: 3
    : It is still not clear what you want to do. In the first post you said that you want to create folders. From this post it seems that you wish to do something else as well, it is not clear what. If you told us what you wish to achieve, then perhaps we would be able to help.
    :
    : CreateDirectory() is a Win API function. Since you are using VB, you must import it from kernel32.dll and then hope and pray that the parameters aren't pointers or other things that aren't supported by the VB language.
    :

    No, I do want to create folders but do not know how exactly to do it the easiest and fastest way.
    IMO:
    I want to create a text file. That one should have the names'folders. Now, I could use batch but AFAIK the folders must use incremental numbers.
    Folder0001
    Folder0002
    Though I want some kind of script to read the names from a text file and then create the folders.
    PC
    Flashy
    Scary
    As I have already asked, this vbs script would involve a lot of copy and paste.

    I hope things are clear now. If not, you know what to do :)

    thanks for now
Sign In or Register to comment.