Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


ini to array

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> ini to array
  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 >>
 ini to array - 10/15/2008 3:17:22 PM   
  mkh

 

Posts: 7
Score: 0
Joined: 10/12/2008
Status: offline
Hello People, I've been searching the forum and alot of other places, but I just can't find a way to load a ini file into a array, is this really so hard to do?
 
 
Post #: 1
 
 RE: ini to array - 10/15/2008 3:24:23 PM   
  dm_4ever


Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
What are you trying to accomplish?  It should be as simple as reading the content using FileSystemObject and adding accordingly.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mkh)
 
 
Post #: 2
 
 RE: ini to array - 10/15/2008 3:41:56 PM   
  mkh

 

Posts: 7
Score: 0
Joined: 10/12/2008
Status: offline
Yes, sorry, I was just about to edit my post, Im trying to copy a few folders over the network, but pt the sources are hardcoded into the script,
trying to get "around" that

dim sendFolders(1)
sendFolders(0) = "C:\Scripts"
sendFolders(1) = "C:\SaveObjects"

my idea was to have a ini with the data setup like this

[sendFolders]
sendFolders1="C:\Scripts"
sendFolders2="C:\SaveObjects"

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: ini to array - 10/16/2008 12:28:35 AM   
  dm_4ever


Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
If you just need paths why not just list them in a text file without complicating it with a ini type syntax?  

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mkh)
 
 
Post #: 4
 
 RE: ini to array - 10/16/2008 1:26:06 AM   
  mkh

 

Posts: 7
Score: 0
Joined: 10/12/2008
Status: offline
Well, the point was to add the sources via a HTA application, but yeah :(

Can this be done using a ini?

all my other settings are located in a ini, I wanna use the same file

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: ini to array - 10/16/2008 1:46:34 AM   
  dm_4ever


Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
You can, look at FileSystemObject to read the file...the thing I don't like about an ini file is you'll have to parse the values out (which I can do using regular expressions, but may be a bit more complicated for someone not familiar with them)

< Message edited by dm_4ever -- 10/16/2008 1:47:36 AM >


_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mkh)
 
 
Post #: 6
 
 RE: ini to array - 10/16/2008 5:50:20 AM   
  mkh

 

Posts: 7
Score: 0
Joined: 10/12/2008
Status: offline
Hm, okay, I'll try the thing is Im not even familiar with VBS, actually Im not even a windows user, been using OS X for the last 3 years, so if somebody would be so kind to show an example of this it would be great... :/

(in reply to dm_4ever)
 
 
Post #: 7
 
 
 
  

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 >> ini to array 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