Help!! Invalid Syntax in VBS script

Help!! Invalid Syntax in VBS script

am 28.12.2005 17:46:04 von Rich

Hello,

The following code sniplet exists in numerous vbscript files that I've
downloaded from Microsoft or other sources. When I run the script, I get the
following error:
Error: Invalid Syntax
Line 7, character 1
Code: 800401e$
Source: (null)


'Option Explicit

Dim ObjIIS
Dim strComputer

strComputer = "LocalHost"
Set objIIS = GetObject("IIS://" & "LocalHost" & "/W3SVC/1")

Wscript.Echo "Access Flags: " & objIIS.AccessFlags
Wscript.Echo "ASP Enable Parent Paths: " & objIIS.AspEnableParentPaths


I don't understand the problem. Can anyone help me?

TIA,
Rich

Re: Help!! Invalid Syntax in VBS script

am 28.12.2005 17:56:29 von Egbert Nierop

"rich" wrote in message
news:D4351A3B-771E-4EFC-9D29-FF0515851899@microsoft.com...
> Hello,
>
> The following code sniplet exists in numerous vbscript files that I've
> downloaded from Microsoft or other sources. When I run the script, I get
> the

Where are you trying to run this?
if you name the file as .vbs it should work.
If you run this within ASP
you should rename the wscript.echo to Response.Write


> following error:
> Error: Invalid Syntax
> Line 7, character 1
> Code: 800401e$
> Source: (null)
>
>
> 'Option Explicit
>
> Dim ObjIIS
> Dim strComputer
>
> strComputer = "LocalHost"
> Set objIIS = GetObject("IIS://" & "LocalHost" & "/W3SVC/1")
>
> Wscript.Echo "Access Flags: " & objIIS.AccessFlags
> Wscript.Echo "ASP Enable Parent Paths: " & objIIS.AspEnableParentPaths
>
>
> I don't understand the problem. Can anyone help me?
>
> TIA,
> Rich

Re: Help!! Invalid Syntax in VBS script

am 28.12.2005 18:05:02 von Rich

I am running the script on my desktop. It should get the various properties
from a remote IIS server.

--Rich

"Egbert Nierop (MVP for IIS)" wrote:

>
> "rich" wrote in message
> news:D4351A3B-771E-4EFC-9D29-FF0515851899@microsoft.com...
> > Hello,
> >
> > The following code sniplet exists in numerous vbscript files that I've
> > downloaded from Microsoft or other sources. When I run the script, I get
> > the
>
> Where are you trying to run this?
> if you name the file as .vbs it should work.
> If you run this within ASP
> you should rename the wscript.echo to Response.Write
>
>
> > following error:
> > Error: Invalid Syntax
> > Line 7, character 1
> > Code: 800401e$
> > Source: (null)
> >
> >
> > 'Option Explicit
> >
> > Dim ObjIIS
> > Dim strComputer
> >
> > strComputer = "LocalHost"
> > Set objIIS = GetObject("IIS://" & "LocalHost" & "/W3SVC/1")
> >
> > Wscript.Echo "Access Flags: " & objIIS.AccessFlags
> > Wscript.Echo "ASP Enable Parent Paths: " & objIIS.AspEnableParentPaths
> >
> >
> > I don't understand the problem. Can anyone help me?
> >
> > TIA,
> > Rich
>
>

Re: Help!! Invalid Syntax in VBS script

am 28.12.2005 18:06:02 von Rich

Oops,

The file is named lwsi.vbs (list web server info.vbs)

"Egbert Nierop (MVP for IIS)" wrote:

>
> "rich" wrote in message
> news:D4351A3B-771E-4EFC-9D29-FF0515851899@microsoft.com...
> > Hello,
> >
> > The following code sniplet exists in numerous vbscript files that I've
> > downloaded from Microsoft or other sources. When I run the script, I get
> > the
>
> Where are you trying to run this?
> if you name the file as .vbs it should work.
> If you run this within ASP
> you should rename the wscript.echo to Response.Write
>
>
> > following error:
> > Error: Invalid Syntax
> > Line 7, character 1
> > Code: 800401e$
> > Source: (null)
> >
> >
> > 'Option Explicit
> >
> > Dim ObjIIS
> > Dim strComputer
> >
> > strComputer = "LocalHost"
> > Set objIIS = GetObject("IIS://" & "LocalHost" & "/W3SVC/1")
> >
> > Wscript.Echo "Access Flags: " & objIIS.AccessFlags
> > Wscript.Echo "ASP Enable Parent Paths: " & objIIS.AspEnableParentPaths
> >
> >
> > I don't understand the problem. Can anyone help me?
> >
> > TIA,
> > Rich
>
>

Re: Help!! Invalid Syntax in VBS script

am 28.12.2005 23:20:07 von Egbert Nierop

"rich" wrote in message
news:244426F5-2109-4317-B70B-F640B0DB0080@microsoft.com...
> Oops,
>
> The file is named lwsi.vbs (list web server info.vbs)

ok,
thanks for clearing up.
Your code is really ok.
I've ran it on my own system, and it just works (on XP with Sp2) and
I named the file test.vbs


It might be a version problem but that sounds very rare. What's your OS?
Do you run specific anti-virus tools, that disable or cripple script?

IN addition, the error code you show us, is 800401e$.
I don't swear, but I'm sure this code is not shown by VBScript normally.
It looks like not CScript.exe or WScript.exe is running your vbs file but
something else that has replaced it.

Can you show us through regedit what is listed below
HKEY_CLASSES_ROOT\VBSFile\Shell\Open
and
HKEY_CLASSES_ROOT\VBSFile\Shell\Open2

Re: Help!! Invalid Syntax in VBS script

am 29.12.2005 16:16:04 von Rich

Hello,

I am running XP/SP2. Other scripts are working. When I run "cscript" from
a command line, it reports WSH v5.6. We run Symantec anti-virus Corp. Ed.
v8.0.x. Confirm that the error code I get is: 800401E4. There is no "$".

Thanks,
Rich

"Egbert Nierop (MVP for IIS)" wrote:

>
> "rich" wrote in message
> news:244426F5-2109-4317-B70B-F640B0DB0080@microsoft.com...
> > Oops,
> >
> > The file is named lwsi.vbs (list web server info.vbs)
>
> ok,
> thanks for clearing up.
> Your code is really ok.
> I've ran it on my own system, and it just works (on XP with Sp2) and
> I named the file test.vbs
>
>
> It might be a version problem but that sounds very rare. What's your OS?
> Do you run specific anti-virus tools, that disable or cripple script?
>
> IN addition, the error code you show us, is 800401e$.
> I don't swear, but I'm sure this code is not shown by VBScript normally.
> It looks like not CScript.exe or WScript.exe is running your vbs file but
> something else that has replaced it.
>
> Can you show us through regedit what is listed below
> HKEY_CLASSES_ROOT\VBSFile\Shell\Open
> and
> HKEY_CLASSES_ROOT\VBSFile\Shell\Open2
>
>
>
>
>

Re: Help!! Invalid Syntax in VBS script

am 29.12.2005 21:12:02 von Rich

"Egbert Nierop (MVP for IIS)" wrote:

>
> "rich" wrote in message
> news:244426F5-2109-4317-B70B-F640B0DB0080@microsoft.com...
> > Oops,
> >
> > The file is named lwsi.vbs (list web server info.vbs)
>
> ok,
> thanks for clearing up.
> Your code is really ok.
> I've ran it on my own system, and it just works (on XP with Sp2) and
> I named the file test.vbs
>
>
> It might be a version problem but that sounds very rare. What's your OS?
> Do you run specific anti-virus tools, that disable or cripple script?
>
> IN addition, the error code you show us, is 800401e$.
> I don't swear, but I'm sure this code is not shown by VBScript normally.
> It looks like not CScript.exe or WScript.exe is running your vbs file but
> something else that has replaced it.
>
> Can you show us through regedit what is listed below
> HKEY_CLASSES_ROOT\VBSFile\Shell\Open
> and
> HKEY_CLASSES_ROOT\VBSFile\Shell\Open2
>

Sorry, forgot to include the registry info:
...\Shell\Command\Open: %systemroot%\system32\wscript.exe %1 %

...\shell\Command\Open2: %systemroot%\system32\cscript.exe %1 %

Re: Help!! Invalid Syntax in VBS script

am 30.12.2005 05:20:33 von someone

Sample code which shows how to retrieve various website properties from IIS,
both local and remote:
http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO_En umerate_IIS_Website_Configuration.aspx

Should be easy to adapt/modify to your needs on a per-website basis.

Example output:

Enumerating websites on localhost

Site ID = 1
Comment = "Default WebSite"
State = Started (MD_SERVER_STATE_STARTED)
LogDir = %WinDir%\System32\LogFiles
IP Address Port Host
All Unassigned 80 *
1.2.3.4 81 *
12.34.56.78 82 HostHeader
All Unassigned 443 *

Site ID = 2
Comment = "Administration Web Site"
State = Started (MD_SERVER_STATE_STOPPED)
LogDir = %WinDir%\System32\LogFiles
IP Address Port Host
All Unassigned 8734 *
All Unassigned 443 *

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"rich" wrote in message
news:57FE4FD1-A0D3-4707-B9DB-2D833D2D1BCD@microsoft.com...
>I am running the script on my desktop. It should get the various
>properties
> from a remote IIS server.
>
> --Rich
>
> "Egbert Nierop (MVP for IIS)" wrote:
>
>>
>> "rich" wrote in message
>> news:D4351A3B-771E-4EFC-9D29-FF0515851899@microsoft.com...
>> > Hello,
>> >
>> > The following code sniplet exists in numerous vbscript files that I've
>> > downloaded from Microsoft or other sources. When I run the script, I
>> > get
>> > the
>>
>> Where are you trying to run this?
>> if you name the file as .vbs it should work.
>> If you run this within ASP
>> you should rename the wscript.echo to Response.Write
>>
>>
>> > following error:
>> > Error: Invalid Syntax
>> > Line 7, character 1
>> > Code: 800401e$
>> > Source: (null)
>> >
>> >
>> > 'Option Explicit
>> >
>> > Dim ObjIIS
>> > Dim strComputer
>> >
>> > strComputer = "LocalHost"
>> > Set objIIS = GetObject("IIS://" & "LocalHost" & "/W3SVC/1")
>> >
>> > Wscript.Echo "Access Flags: " & objIIS.AccessFlags
>> > Wscript.Echo "ASP Enable Parent Paths: " & objIIS.AspEnableParentPaths
>> >
>> >
>> > I don't understand the problem. Can anyone help me?
>> >
>> > TIA,
>> > Rich
>>
>>

Re: Help!! Invalid Syntax in VBS script

am 30.12.2005 09:30:52 von Egbert Nierop

"rich" wrote in message
news:1DF7CF38-71BF-4D7C-9541-93602E469838@microsoft.com...
>
>

>> IN addition, the error code you show us, is 800401e$.
>> I don't swear, but I'm sure this code is not shown by VBScript normally.
>> It looks like not CScript.exe or WScript.exe is running your vbs file but
>> something else that has replaced it.
>>
>> Can you show us through regedit what is listed below
>> HKEY_CLASSES_ROOT\VBSFile\Shell\Open
>> and
>> HKEY_CLASSES_ROOT\VBSFile\Shell\Open2
>>
>
> Sorry, forgot to include the registry info:
> ..\Shell\Command\Open: %systemroot%\system32\wscript.exe %1 %
>
> ..\shell\Command\Open2: %systemroot%\system32\cscript.exe %1 %

ok, all looks ok.
Just try just once, to disable your virustools and try your code again.