Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

Command Line Arguments Problem

Post new topic   Reply to topic    Abyssmedia.com Forum Index -> ScriptCryptor
View previous topic :: View next topic  
Author Message

Joined: 23 Nov 2009
Posts: 1

PostPosted: Mon Nov 23, 2009 9:32 pm    Post subject: Command Line Arguments Problem Reply with quote

There was a post from 2008 which mentioned this, but it appears to not be resolved yet. I can likely use the workaround indicated in that post, but this will cause me to have to rework a number of scripts. Is it possible to fix this so that it works?

In my script code, I use some command line arguments to change functionality of the application, like indicating a new config file, asking for usage syntax, and so on. However, the following lines fail:

if WScript.Arguments.Count > 0 then
WScript.Echo WScript.Arguments.Count&" Arguments Found"
for each arg in WScript.Arguments.Named
(do something)
end if

When it gets to the FOR loop, the following error is generated:
Microsoft VBScript runtime error
Error: Object not a collection

I am using the "Named" capability because I later pull out the value from the parameter. For example, one of my arguments is "/config:<configfile>", for which I can use this command to get the needed value:
WScript.Echo "Loading Alternate Configuration "&WScript.Arguments.Named.Item(arg)

I find that this does NOT work with the workaround, and it looks like I have to manually parse a bunch of strings instead of using thebuilt in features of WScript.

Looks like this may be a hole in the ScriptCryptor capabilties?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> ScriptCryptor All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001-2011 phpBB Group