Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 26th, 2012, 06:19 PM
Ruriko Ruriko is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 8 Ruriko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 44 sec
Reputation Power: 0
Create folder from text file with Vbscript

I am trying to make a script that will read from a text file and create those folders. In my text file it contains:

Code:
C:\Users\Susan\Documents\iMacros\Downloads\(C82) [Imperial Chicken (Fujisaka Kuuki)] OZ (Neon Genesis Evangelion)[Decensored][English]
C:\Users\Susan\Documents\iMacros\Downloads\(C82) [Hachiouji Kaipan Totsugeki Kiheitai (Makita Yoshiharu)] Just Want Moyashi! (Nisekoi, Raikkonen no Nettaigyo) (English)
C:\Users\Susan\Documents\iMacros\Downloads\[Shimekiri Sanpunmae (Tsukimi Daifuku)] Ichika I'll Make You Feel Good (Infinite Stratos) (Eng) [Life4Kaoru]
C:\Users\Susan\Documents\iMacros\Downloads\[Nakayohi Mogudan (Mogudan)] Gentei Omakehon 2005.2 (Neon Genesis Evangelion) [ENG] [LWB]
C:\Users\Susan\Documents\iMacros\Downloads\(C82) [Kuronishiki (Takaharu)] A.Tsu.I.Yo.Ru (Touhou Project) [English] [CGrascal]
C:\Users\Susan\Documents\iMacros\Downloads\(COMIC1☆6) [Dokuebi. (Antaresu 11)] Despair☠Pirates (Mouretsu Pirates) [English] =LWB=
C:\Users\Susan\Documents\iMacros\Downloads\(C82) [Type-G (Ishigaki Takashi)] Ore to NanoFei to One Room (Mahou Shoujo Lyrical Nanoha StrikerS) [English] =TV + Afro=
C:\Users\Susan\Documents\iMacros\Downloads\[Kesshoku Mikan] Cobalt Delphinium (English) (Resident Evil) {doujin-moe.us}
C:\Users\Susan\Documents\iMacros\Downloads\[Clesta (Cle Masahiro)] CL-orz 23 (Kyoukai Senjou no Horizon) [English] [doujin-moe.us]
C:\Users\Susan\Documents\iMacros\Downloads\(C82) [Number2 (Takuji)] Datte Aniki wa Nama Ecchi Suki damon (Ore no Imouto ga Konna ni Kawaii Wake ga Nai) [English] [PineApples R' Us + Doujin-Moe.us]
C:\Users\Susan\Documents\iMacros\Downloads\(C82) [Number2 (Takuji)] Damette Ittemo Nakadashi Surundesuyone (Ore no Imouto ga Konna ni Kawaii Wake ga Nai) [English] [PineApples R' Us + Doujin-Moe.us]


This is the script. Can anyone help me fix it?

Code:
dim objFileSys, objReadFile
Const ForReading = 1, ForWriting = 2, ForAppending = 8

Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFileSys.OpenTextFile("C:\Users\Susan\Documents\iMacros\Macros\file.txt", ForReading)

Do until objReadFile.AtEndOfStream = True
    objFileSys.CreateFolder(objReadFile.ReadLine)

Loop
objReadFile.Close
Set objReadFile = Nothing
Set objFileSys = Nothing


http://i.imgur.com/4zrlZ.jpg

Reply With Quote
  #2  
Old August 27th, 2012, 11:27 AM
couttsj couttsj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 165 couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 16 h 29 m 48 sec
Reputation Power: 43
Your problem is with the directory names. For reasons unknown to me, the brackets are converted to angle brackets, which are an illegal character unless they are inside quotes. Also, if spaces are encountered that are not inside quotes, more than one directory will be created. Do the directory names need to be so convoluted?

J.A. Coutts

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Create folder from text file with Vbscript

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap