Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: If, Else If unable to get it to work

HTVi
TV Discussion Newsgroups

If, Else If unable to get it to work
CypherBit 6/10/2007 2:19:01 PM
I found this code here:
http://www.tech-forums.net/showthread.php?s=&threadid=138872 which I'd love
to use, but it has all sorts of weird chars in it. Since I have close to zero
(very close) knowledge here I'd greatly appreciate it if some one could clean
it up.

I basically want to run a given program if the first argument is true,
something else if the 2nd and if not, then something else.

Welcome in advance.
Re: If, Else If unable to get it to work
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 6/10/2007 4:09:00 PM

"CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
news:73A1EF8C-BB68-47C0-BC0A-0692D3AA7B8B[ at ]microsoft.com...
[Quoted Text]
>I found this code here:
> http://www.tech-forums.net/showthread.php?s=&threadid=138872 which I'd
> love
> to use, but it has all sorts of weird chars in it. Since I have close to
> zero
> (very close) knowledge here I'd greatly appreciate it if some one could
> clean
> it up.
>
> I basically want to run a given program if the first argument is true,
> something else if the 2nd and if not, then something else.
>
> Welcome in advance.

I tried my hand at it and came up with this:

'===
dim WshShell

Set WshShell = WScript.CreateObject("WScript.Shell")

wscript.echo Wscript.Arguments.Item(2)

if Wscript.Arguments.Item(1) = "g318606D2" then

WshShell.run "D:\Program Files\TrueCrypt\TrueCrypt.exe /v " _
& Wscript.Arguments.Item(0) _
& " g:\d1.tc /lz /q", 1, true

elseif Wscript.Arguments.Item(2) = "PackardBell" then

WshShell.run "D:\Program Files\2xExplorer\2xExplorer.exe
D:\MyDirsD\Temp\PodcastQueue " _
& Wscript.Arguments.Item(0) & "g:\", 1, true

else

WshShell.run "D:\Program Files\Network Associates\VirusScan\csscan.exe
/target " _
& Wscript.Arguments.Item(0) _
& "g: /secure /quiet /log D:\Program Files\USBVirusScan\log.txt",
1, true

end if

'===

I don't know what the extraneous characters were doing there, but some
seemed to be representing a double-quote ("). There are likely errors still
remaining, as I do not think it likely that the name of the executable to be
run in the elseif block is "2xEcplorer.exe" or that one of its parameters
would have "g:\" appended to it with no intervening space.

I do think I have sorted out the three cases for you, though. Now it is just
a matter of reconstructing the .run parameters correctly.

/Al


Re: If, Else If unable to get it to work
CypherBit 6/10/2007 4:54:01 PM

"Al Dunbar" wrote:

[Quoted Text]
>
> "CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
> news:73A1EF8C-BB68-47C0-BC0A-0692D3AA7B8B[ at ]microsoft.com...
> >I found this code here:
> > http://www.tech-forums.net/showthread.php?s=&threadid=138872 which I'd
> > love
> > to use, but it has all sorts of weird chars in it. Since I have close to
> > zero
> > (very close) knowledge here I'd greatly appreciate it if some one could
> > clean
> > it up.
> >
> > I basically want to run a given program if the first argument is true,
> > something else if the 2nd and if not, then something else.
> >
> > Welcome in advance.
>
> I tried my hand at it and came up with this:
>
> '===
> dim WshShell
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
>
> wscript.echo Wscript.Arguments.Item(2)
>
> if Wscript.Arguments.Item(1) = "g318606D2" then
>
> WshShell.run "D:\Program Files\TrueCrypt\TrueCrypt.exe /v " _
> & Wscript.Arguments.Item(0) _
> & " g:\d1.tc /lz /q", 1, true
>
> elseif Wscript.Arguments.Item(2) = "PackardBell" then
>
> WshShell.run "D:\Program Files\2xExplorer\2xExplorer.exe
> D:\MyDirsD\Temp\PodcastQueue " _
> & Wscript.Arguments.Item(0) & "g:\", 1, true
>
> else
>
> WshShell.run "D:\Program Files\Network Associates\VirusScan\csscan.exe
> /target " _
> & Wscript.Arguments.Item(0) _
> & "g: /secure /quiet /log D:\Program Files\USBVirusScan\log.txt",
> 1, true
>
> end if
>
> '===
>
> I don't know what the extraneous characters were doing there, but some
> seemed to be representing a double-quote ("). There are likely errors still
> remaining, as I do not think it likely that the name of the executable to be
> run in the elseif block is "2xEcplorer.exe" or that one of its parameters
> would have "g:\" appended to it with no intervening space.
>
> I do think I have sorted out the three cases for you, though. Now it is just
> a matter of reconstructing the .run parameters correctly.
>
> /Al
>
>
>

Thank you very much for the quick response and cleaning up the code. Could
you perhaps help me out a bit more. In the structure in the first if there
are multiple & I'd very much like to simplify this if possible, but am
running into problems. This is what I currently have:

dim WshShell

Set WshShell = WScript.CreateObject("WScript.Shell")

wscript.echo Wscript.Arguments.Item(2)

if Wscript.Arguments.Item(1) = "g318606D2" then

WshShell.run "d:\username\programs\usbvirusscan\something.bat" _
& Wscript.Arguments.Item(0) , 1, true

elseif Wscript.Arguments.Item(2) = "PackardBell" then

WshShell.run "d:\username\programs\usbvirusscan\somethingelse.bat" _
& Wscript.Arguments.Item(0) , 1, true

else

WshShell.run "D:\Program Files\Network Associates\VirusScan\csscan.exe
/target " _
& Wscript.Arguments.Item(0) _
& "g: /secure /quiet /log D:\Program Files\USBVirusScan\log.txt", 1, true

end if

but if I run that from a cmd prompt using wscript code.vbs I get a
"Subscript out of range" 800A0009 Line 5, Char 1.

Any ideas why? What am I doing wrong? BTW I also get errors when running
exactly what you posted.



Re: If, Else If unable to get it to work
urkec 6/10/2007 5:40:01 PM
"CypherBit" wrote:


[Quoted Text]
> if I run that from a cmd prompt using wscript code.vbs I get a
> "Subscript out of range" 800A0009 Line 5, Char 1.
>

Try running it like:

cscript code.vbs arg1 arg2 arg3

--
urkec


Re: If, Else If unable to get it to work
CypherBit 6/10/2007 8:16:00 PM


"urkec" wrote:

[Quoted Text]
> "CypherBit" wrote:
>
>
> > if I run that from a cmd prompt using wscript code.vbs I get a
> > "Subscript out of range" 800A0009 Line 5, Char 1.
> >
>
> Try running it like:
>
> cscript code.vbs arg1 arg2 arg3
>
> --
> urkec
>
>
I get a different set of errors if I try that. Don't you also get errors
when executing the above scripts?

I'd appreciate it if someone could either correct the original (or the one
from Al Dunbar) or write something that does the same thing, but from
scratch. I have no idea how difficult that might be, but from the looks of
it, I'm sure there's a way.
Re: If, Else If unable to get it to work
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 6/11/2007 10:39:03 PM

"CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
news:E76543AC-5543-4CF7-9ECF-2C3EB1C558B2[ at ]microsoft.com...
[Quoted Text]
>
>
> "urkec" wrote:
>
>> "CypherBit" wrote:
>>
>>
>> > if I run that from a cmd prompt using wscript code.vbs I get a
>> > "Subscript out of range" 800A0009 Line 5, Char 1.
>> >
>>
>> Try running it like:
>>
>> cscript code.vbs arg1 arg2 arg3
>>
>> --
>> urkec
>>
>>
> I get a different set of errors if I try that. Don't you also get errors
> when executing the above scripts?

Why would urkec or me actually run these scripts when we likely do not have
all of the programs that they are trying to run? It was not my intention to
give you a final solution, just help you with ironing out some of the
problems with the script you found.

> I'd appreciate it if someone could either correct the original (or the one
> from Al Dunbar) or write something that does the same thing,

Does the same thing as what - what the original and my adaptation do? They
throw errors, so I hardly think you want someone to write a script that does
the same thing.

Perhaps you want someone to adapt or write a script that does what you want
it to do. But given that the only information we have to go on is the faulty
script you showed us. I don't know, for example, what it is specifically
that the arguments mean, or what it is that the programs and batch files you
mention are supposed to do, let alone exactly what information needs to be
supplied them.

> but from
> scratch. I have no idea how difficult that might be, but from the looks of
> it, I'm sure there's a way.

It's not difficult. But you do not yet have a solution because you have not
yet provided all the information required to produce one. First, I
understand that, depending on the values of parameters supplied to the
script, you want it to run one of three different commands. You seem to be a
bit uncomfortable with vbscript, but perhaps if you would show us exacly
what the equivalent commands typed at a command prompt should be, then we
could get a bit farther.

/Al


Re: If, Else If unable to get it to work
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 6/11/2007 10:39:10 PM

"CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
news:F2D90718-C10F-4D36-BC31-AF9C7D98F711[ at ]microsoft.com...
[Quoted Text]
>
> "Al Dunbar" wrote:
>
>>
>> "CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
>> news:73A1EF8C-BB68-47C0-BC0A-0692D3AA7B8B[ at ]microsoft.com...
>> >I found this code here:
>> > http://www.tech-forums.net/showthread.php?s=&threadid=138872 which I'd
>> > love
>> > to use, but it has all sorts of weird chars in it. Since I have close
>> > to
>> > zero
>> > (very close) knowledge here I'd greatly appreciate it if some one could
>> > clean
>> > it up.
>> >
>> > I basically want to run a given program if the first argument is true,
>> > something else if the 2nd and if not, then something else.
>> >
>> > Welcome in advance.
>>
>> I tried my hand at it and came up with this:
>>
>> '===
>> dim WshShell
>>
>> Set WshShell = WScript.CreateObject("WScript.Shell")
>>
>> wscript.echo Wscript.Arguments.Item(2)
>>
>> if Wscript.Arguments.Item(1) = "g318606D2" then
>>
>> WshShell.run "D:\Program Files\TrueCrypt\TrueCrypt.exe /v " _
>> & Wscript.Arguments.Item(0) _
>> & " g:\d1.tc /lz /q", 1, true
>>
>> elseif Wscript.Arguments.Item(2) = "PackardBell" then
>>
>> WshShell.run "D:\Program Files\2xExplorer\2xExplorer.exe
>> D:\MyDirsD\Temp\PodcastQueue " _
>> & Wscript.Arguments.Item(0) & "g:\", 1, true
>>
>> else
>>
>> WshShell.run "D:\Program Files\Network
>> Associates\VirusScan\csscan.exe
>> /target " _
>> & Wscript.Arguments.Item(0) _
>> & "g: /secure /quiet /log D:\Program
>> Files\USBVirusScan\log.txt",
>> 1, true
>>
>> end if
>>
>> '===
>>
>> I don't know what the extraneous characters were doing there, but some
>> seemed to be representing a double-quote ("). There are likely errors
>> still
>> remaining, as I do not think it likely that the name of the executable to
>> be
>> run in the elseif block is "2xEcplorer.exe" or that one of its parameters
>> would have "g:\" appended to it with no intervening space.
>>
>> I do think I have sorted out the three cases for you, though. Now it is
>> just
>> a matter of reconstructing the .run parameters correctly.
>>
>> /Al
>>
>>
>>
>
> Thank you very much for the quick response and cleaning up the code. Could
> you perhaps help me out a bit more. In the structure in the first if there
> are multiple & I'd very much like to simplify this if possible, but am
> running into problems. This is what I currently have:
>
> dim WshShell
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
>
> wscript.echo Wscript.Arguments.Item(2)
>
> if Wscript.Arguments.Item(1) = "g318606D2" then
>
> WshShell.run "d:\username\programs\usbvirusscan\something.bat" _
> & Wscript.Arguments.Item(0) , 1, true
>
> elseif Wscript.Arguments.Item(2) = "PackardBell" then
>
> WshShell.run "d:\username\programs\usbvirusscan\somethingelse.bat" _
> & Wscript.Arguments.Item(0) , 1, true
>
> else
>
> WshShell.run "D:\Program Files\Network Associates\VirusScan\csscan.exe
> /target " _
> & Wscript.Arguments.Item(0) _
> & "g: /secure /quiet /log D:\Program Files\USBVirusScan\log.txt", 1, true
>
> end if
>
> but if I run that from a cmd prompt using wscript code.vbs I get a
> "Subscript out of range" 800A0009 Line 5, Char 1.

This seems likely because you did not provide three command line arguments
so that there would be one to correspond to "Wscript.Arguments.Item(2)"

> Any ideas why? What am I doing wrong? BTW I also get errors when running
> exactly what you posted.

Did you not read where I said: "There are likely errors still remaining"?
After all, I did not have access to test this on your computer, and my
computer does not have the programs installed on it that you want to run,

/Al



Re: If, Else If unable to get it to work
CypherBit 6/14/2007 1:42:03 PM
Al Dunbar thank you for your persistence.

What I'd need to script to do is quite simple. USBviruscan (more info in the
link in my original post) is an app that can perform certain functions when a
USB key is inserted. I'd like it to perform one task if a USB drive with a
certain volume name is inserted, another thing if a USB with a certain volume
serial number is inserted and if the name or the serial number of the
inserted USB key doesn't match I want it to perform a virus scan using McAfee
AV.

I'd very appreciate it if someone could correct or point me in the right
direction, so the first condition would run any .exe (no arguments), and the
2nd a batch file. I don't imagine there are many differences there. As for
the else if part, McAfee AV should be run. If that is not installed on your
system I'll try to figure it out on my own, based on the code given.

Please let me know if further details are needed.

"Al Dunbar" wrote:

[Quoted Text]
>
> "CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
> news:F2D90718-C10F-4D36-BC31-AF9C7D98F711[ at ]microsoft.com...
> >
> > "Al Dunbar" wrote:
> >
> >>
> >> "CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
> >> news:73A1EF8C-BB68-47C0-BC0A-0692D3AA7B8B[ at ]microsoft.com...
> >> >I found this code here:
> >> > http://www.tech-forums.net/showthread.php?s=&threadid=138872 which I'd
> >> > love
> >> > to use, but it has all sorts of weird chars in it. Since I have close
> >> > to
> >> > zero
> >> > (very close) knowledge here I'd greatly appreciate it if some one could
> >> > clean
> >> > it up.
> >> >
> >> > I basically want to run a given program if the first argument is true,
> >> > something else if the 2nd and if not, then something else.
> >> >
> >> > Welcome in advance.
> >>
> >> I tried my hand at it and came up with this:
> >>
> >> '===
> >> dim WshShell
> >>
> >> Set WshShell = WScript.CreateObject("WScript.Shell")
> >>
> >> wscript.echo Wscript.Arguments.Item(2)
> >>
> >> if Wscript.Arguments.Item(1) = "g318606D2" then
> >>
> >> WshShell.run "D:\Program Files\TrueCrypt\TrueCrypt.exe /v " _
> >> & Wscript.Arguments.Item(0) _
> >> & " g:\d1.tc /lz /q", 1, true
> >>
> >> elseif Wscript.Arguments.Item(2) = "PackardBell" then
> >>
> >> WshShell.run "D:\Program Files\2xExplorer\2xExplorer.exe
> >> D:\MyDirsD\Temp\PodcastQueue " _
> >> & Wscript.Arguments.Item(0) & "g:\", 1, true
> >>
> >> else
> >>
> >> WshShell.run "D:\Program Files\Network
> >> Associates\VirusScan\csscan.exe
> >> /target " _
> >> & Wscript.Arguments.Item(0) _
> >> & "g: /secure /quiet /log D:\Program
> >> Files\USBVirusScan\log.txt",
> >> 1, true
> >>
> >> end if
> >>
> >> '===
> >>
> >> I don't know what the extraneous characters were doing there, but some
> >> seemed to be representing a double-quote ("). There are likely errors
> >> still
> >> remaining, as I do not think it likely that the name of the executable to
> >> be
> >> run in the elseif block is "2xEcplorer.exe" or that one of its parameters
> >> would have "g:\" appended to it with no intervening space.
> >>
> >> I do think I have sorted out the three cases for you, though. Now it is
> >> just
> >> a matter of reconstructing the .run parameters correctly.
> >>
> >> /Al
> >>
> >>
> >>
> >
> > Thank you very much for the quick response and cleaning up the code. Could
> > you perhaps help me out a bit more. In the structure in the first if there
> > are multiple & I'd very much like to simplify this if possible, but am
> > running into problems. This is what I currently have:
> >
> > dim WshShell
> >
> > Set WshShell = WScript.CreateObject("WScript.Shell")
> >
> > wscript.echo Wscript.Arguments.Item(2)
> >
> > if Wscript.Arguments.Item(1) = "g318606D2" then
> >
> > WshShell.run "d:\username\programs\usbvirusscan\something.bat" _
> > & Wscript.Arguments.Item(0) , 1, true
> >
> > elseif Wscript.Arguments.Item(2) = "PackardBell" then
> >
> > WshShell.run "d:\username\programs\usbvirusscan\somethingelse.bat" _
> > & Wscript.Arguments.Item(0) , 1, true
> >
> > else
> >
> > WshShell.run "D:\Program Files\Network Associates\VirusScan\csscan.exe
> > /target " _
> > & Wscript.Arguments.Item(0) _
> > & "g: /secure /quiet /log D:\Program Files\USBVirusScan\log.txt", 1, true
> >
> > end if
> >
> > but if I run that from a cmd prompt using wscript code.vbs I get a
> > "Subscript out of range" 800A0009 Line 5, Char 1.
>
> This seems likely because you did not provide three command line arguments
> so that there would be one to correspond to "Wscript.Arguments.Item(2)"
>
> > Any ideas why? What am I doing wrong? BTW I also get errors when running
> > exactly what you posted.
>
> Did you not read where I said: "There are likely errors still remaining"?
> After all, I did not have access to test this on your computer, and my
> computer does not have the programs installed on it that you want to run,
>
> /Al
>
>
>
>
Re: If, Else If unable to get it to work
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 6/15/2007 4:07:52 AM

"CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
news:67D6BEFF-2CCE-4DC6-9EF7-6A4A11B1D510[ at ]microsoft.com...
[Quoted Text]
> Al Dunbar thank you for your persistence.
>
> What I'd need to script to do is quite simple. USBviruscan (more info in
> the
> link in my original post)

Unfortunately, the spurious characters you were having trouble with seem to
be obscuring exactly how this program is run.

> is an app that can perform certain functions when a
> USB key is inserted. I'd like it to perform one task if a USB drive with a
> certain volume name is inserted, another thing if a USB with a certain
> volume
> serial number is inserted and if the name or the serial number of the
> inserted USB key doesn't match I want it to perform a virus scan using
> McAfee
> AV.

But the script you are trying to adapt is working with passed parameters,
not checking the USB drive to see what its volume serial number is.

> I'd very appreciate it if someone could correct or point me in the right
> direction, so the first condition

Although the code is still problematic, the first condition has to do with a
passed parameter, not a volume serial number - unless a batch file is
figuring that out and passing it to the script.

> would run any .exe (no arguments), and the
> 2nd a batch file. I don't imagine there are many differences there. As for
> the else if part, McAfee AV should be run. If that is not installed on
> your
> system I'll try to figure it out on my own, based on the code given.
>
> Please let me know if further details are needed.

Unfortunately, I am still having some difficulty in figuring out exactly
what it is that you want the script to do. Based on what you say, you could
want the script to run automatically when a USB key is inserted, or you
could want the script to be run manually and somehow deduce the drive letter
of the USB key, or you could want the user to indicate where the USB key is
located.

/Al


> "Al Dunbar" wrote:
>
>>
>> "CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
>> news:F2D90718-C10F-4D36-BC31-AF9C7D98F711[ at ]microsoft.com...
>> >
>> > "Al Dunbar" wrote:
>> >
>> >>
>> >> "CypherBit" <CypherBit[ at ]discussions.microsoft.com> wrote in message
>> >> news:73A1EF8C-BB68-47C0-BC0A-0692D3AA7B8B[ at ]microsoft.com...
>> >> >I found this code here:
>> >> > http://www.tech-forums.net/showthread.php?s=&threadid=138872 which
>> >> > I'd
>> >> > love
>> >> > to use, but it has all sorts of weird chars in it. Since I have
>> >> > close
>> >> > to
>> >> > zero
>> >> > (very close) knowledge here I'd greatly appreciate it if some one
>> >> > could
>> >> > clean
>> >> > it up.
>> >> >
>> >> > I basically want to run a given program if the first argument is
>> >> > true,
>> >> > something else if the 2nd and if not, then something else.
>> >> >
>> >> > Welcome in advance.
>> >>
>> >> I tried my hand at it and came up with this:
>> >>
>> >> '===
>> >> dim WshShell
>> >>
>> >> Set WshShell = WScript.CreateObject("WScript.Shell")
>> >>
>> >> wscript.echo Wscript.Arguments.Item(2)
>> >>
>> >> if Wscript.Arguments.Item(1) = "g318606D2" then
>> >>
>> >> WshShell.run "D:\Program Files\TrueCrypt\TrueCrypt.exe /v " _
>> >> & Wscript.Arguments.Item(0) _
>> >> & " g:\d1.tc /lz /q", 1, true
>> >>
>> >> elseif Wscript.Arguments.Item(2) = "PackardBell" then
>> >>
>> >> WshShell.run "D:\Program Files\2xExplorer\2xExplorer.exe
>> >> D:\MyDirsD\Temp\PodcastQueue " _
>> >> & Wscript.Arguments.Item(0) & "g:\", 1, true
>> >>
>> >> else
>> >>
>> >> WshShell.run "D:\Program Files\Network
>> >> Associates\VirusScan\csscan.exe
>> >> /target " _
>> >> & Wscript.Arguments.Item(0) _
>> >> & "g: /secure /quiet /log D:\Program
>> >> Files\USBVirusScan\log.txt",
>> >> 1, true
>> >>
>> >> end if
>> >>
>> >> '===
>> >>
>> >> I don't know what the extraneous characters were doing there, but some
>> >> seemed to be representing a double-quote ("). There are likely errors
>> >> still
>> >> remaining, as I do not think it likely that the name of the executable
>> >> to
>> >> be
>> >> run in the elseif block is "2xEcplorer.exe" or that one of its
>> >> parameters
>> >> would have "g:\" appended to it with no intervening space.
>> >>
>> >> I do think I have sorted out the three cases for you, though. Now it
>> >> is
>> >> just
>> >> a matter of reconstructing the .run parameters correctly.
>> >>
>> >> /Al
>> >>
>> >>
>> >>
>> >
>> > Thank you very much for the quick response and cleaning up the code.
>> > Could
>> > you perhaps help me out a bit more. In the structure in the first if
>> > there
>> > are multiple & I'd very much like to simplify this if possible, but am
>> > running into problems. This is what I currently have:
>> >
>> > dim WshShell
>> >
>> > Set WshShell = WScript.CreateObject("WScript.Shell")
>> >
>> > wscript.echo Wscript.Arguments.Item(2)
>> >
>> > if Wscript.Arguments.Item(1) = "g318606D2" then
>> >
>> > WshShell.run "d:\username\programs\usbvirusscan\something.bat" _
>> > & Wscript.Arguments.Item(0) , 1, true
>> >
>> > elseif Wscript.Arguments.Item(2) = "PackardBell" then
>> >
>> > WshShell.run "d:\username\programs\usbvirusscan\somethingelse.bat" _
>> > & Wscript.Arguments.Item(0) , 1, true
>> >
>> > else
>> >
>> > WshShell.run "D:\Program Files\Network Associates\VirusScan\csscan.exe
>> > /target " _
>> > & Wscript.Arguments.Item(0) _
>> > & "g: /secure /quiet /log D:\Program Files\USBVirusScan\log.txt", 1,
>> > true
>> >
>> > end if
>> >
>> > but if I run that from a cmd prompt using wscript code.vbs I get a
>> > "Subscript out of range" 800A0009 Line 5, Char 1.
>>
>> This seems likely because you did not provide three command line
>> arguments
>> so that there would be one to correspond to "Wscript.Arguments.Item(2)"
>>
>> > Any ideas why? What am I doing wrong? BTW I also get errors when
>> > running
>> > exactly what you posted.
>>
>> Did you not read where I said: "There are likely errors still remaining"?
>> After all, I did not have access to test this on your computer, and my
>> computer does not have the programs installed on it that you want to run,
>>
>> /Al
>>
>>
>>
>>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen