Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Help!! Invalid Syntax in VBS script

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  Creating a URL still exists page/util  
Author Message
rich

External


Since: Oct 21, 2005
Posts: 14



(Msg. 1) Posted: Wed Dec 28, 2005 8:46 am
Post subject: Help!! Invalid Syntax in VBS script
Archived from groups: microsoft>public>inetserver>iis (more info?)

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

 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
"Egbert Nierop

External


Since: Oct 14, 2005
Posts: 201



(Msg. 2) Posted: Wed Dec 28, 2005 12:55 pm
Post subject: Re: Help!! Invalid Syntax in VBS script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"rich" <rich.DeleteThis@discussions.microsoft.com> 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

 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
rich

External


Since: Oct 21, 2005
Posts: 14



(Msg. 3) Posted: Wed Dec 28, 2005 12:55 pm
Post subject: Re: Help!! Invalid Syntax in VBS script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Oops,

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

"Egbert Nierop (MVP for IIS)" wrote:

>
> "rich" <rich.DeleteThis@discussions.microsoft.com> 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
>
>
 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
rich

External


Since: Oct 21, 2005
Posts: 14



(Msg. 4) Posted: Wed Dec 28, 2005 12:55 pm
Post subject: Re: Help!! Invalid Syntax in VBS script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <rich.TakeThisOut@discussions.microsoft.com> 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
>
>
 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
"Egbert Nierop

External


Since: Oct 14, 2005
Posts: 201



(Msg. 5) Posted: Wed Dec 28, 2005 5:55 pm
Post subject: Re: Help!! Invalid Syntax in VBS script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"rich" <rich DeleteThis @discussions.microsoft.com> 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
 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
rich

External


Since: Oct 21, 2005
Posts: 14



(Msg. 6) Posted: Thu Dec 29, 2005 7:16 am
Post subject: Re: Help!! Invalid Syntax in VBS script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <rich.RemoveThis@discussions.microsoft.com> 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
>
>
>
>
>
 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
rich

External


Since: Oct 21, 2005
Posts: 14



(Msg. 7) Posted: Thu Dec 29, 2005 12:12 pm
Post subject: Re: Help!! Invalid Syntax in VBS script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Egbert Nierop (MVP for IIS)" wrote:

>
> "rich" <rich.RemoveThis@discussions.microsoft.com> 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 %
 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
"Egbert Nierop

External


Since: Oct 14, 2005
Posts: 201



(Msg. 8) Posted: Fri Dec 30, 2005 4:55 am
Post subject: Re: Help!! Invalid Syntax in VBS script [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"rich" <rich.DeleteThis@discussions.microsoft.com> 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.
 >> Stay informed about: Help!! Invalid Syntax in VBS script 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can 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



[ Contact us | Terms of Service/Privacy Policy ]