msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

login script error

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
frank



Joined: 04 Oct 2007
Posts: 7

PostPosted: Wed Oct 03, 2007 11:27 am    Post subject: login script error Reply with quote

I am trying creat a login script and gave me the following error

line 3 char 24 error: expected end of sdtatement code 800a040 source
microsoft vbscript complication error

I have list below the script:
--------------------------------
On Error Resume Next

Set oNet = CreateObject"WScript.Network"
sUserName = oNet.UserName
oNet.MapNetworkDrive "X:", "x: \\xyz.com\fs\employee_folder\" & sUserName
oNet.MapNetworkDrive "Y:", "y: \\xyz.com\fs\departments"
oNet.MapNetworkDrive "Z:", "z: \\xyz.com\fs\public"

Set oNet = Nothing
-----------------------------------

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Wed Oct 03, 2007 12:15 pm    Post subject: Re: login script error Reply with quote

"frank" wrote in message @microsoft.com...
>I am trying creat a login script and gave me the following error
>
> line 3 char 24 error: expected end of sdtatement code 800a040 source
> microsoft vbscript complication error
>
> I have list below the script:
> --------------------------------
> On Error Resume Next
>
> Set oNet = CreateObject"WScript.Network"

Set oNet = CreateObject("WScript.Network")

> sUserName = oNet.UserName
> oNet.MapNetworkDrive "X:", "x: \\xyz.com\fs\employee_folder\" & sUserName
> oNet.MapNetworkDrive "Y:", "y: \\xyz.com\fs\departments"
> oNet.MapNetworkDrive "Z:", "z: \\xyz.com\fs\public"
>
> Set oNet = Nothing
> -----------------------------------
>
>
Back to top
View user's profile Send private message
frank



Joined: 04 Oct 2007
Posts: 7

PostPosted: Wed Oct 03, 2007 12:43 pm    Post subject: Re: login script error Reply with quote

Bob thank you for the help the only issue it does not map the x: drive

it should map a x: to userlogin example I have a test foler it should login
to
x: \\xyz.com\fs\employee_folder\test
but it is not happen


can you please help





"Bob Butler" wrote:

> "frank" wrote in message
> @microsoft.com...
> >I am trying creat a login script and gave me the following error
> >
> > line 3 char 24 error: expected end of sdtatement code 800a040 source
> > microsoft vbscript complication error
> >
> > I have list below the script:
> > --------------------------------
> > On Error Resume Next
> >
> > Set oNet = CreateObject"WScript.Network"
>
> Set oNet = CreateObject("WScript.Network")
>
> > sUserName = oNet.UserName
> > oNet.MapNetworkDrive "X:", "x: \\xyz.com\fs\employee_folder\" & sUserName
> > oNet.MapNetworkDrive "Y:", "y: \\xyz.com\fs\departments"
> > oNet.MapNetworkDrive "Z:", "z: \\xyz.com\fs\public"
> >
> > Set oNet = Nothing
> > -----------------------------------
> >
> >
>
>
>
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Wed Oct 03, 2007 1:15 pm    Post subject: Re: login script error Reply with quote

"frank" wrote in message @microsoft.com...
> Bob thank you for the help the only issue it does not map the x: drive
>
> it should map a x: to userlogin example I have a test foler it should
> login
> to
> x: \\xyz.com\fs\employee_folder\test
> but it is not happen

>> > oNet.MapNetworkDrive "X:", "x: \\xyz.com\fs\employee_folder\" &
>> > sUserName
>> > oNet.MapNetworkDrive "Y:", "y: \\xyz.com\fs\departments"
>> > oNet.MapNetworkDrive "Z:", "z: \\xyz.com\fs\public"

oNet.MapNetworkDrive "X:", "\\xyz.com\fs\employee_folder\" & sUserName
oNet.MapNetworkDrive "Y:", "\\xyz.com\fs\departments"
oNet.MapNetworkDrive "Z:", "\\xyz.com\fs\public"
Back to top
View user's profile Send private message
frank



Joined: 04 Oct 2007
Posts: 7

PostPosted: Wed Oct 03, 2007 1:50 pm    Post subject: Re: login script error Reply with quote

the error is
script: \\domain02\netlogon\test.vbs
line : 2
char 1
error object required '[string: "test"]'
code: 800a01a8
source: microsoft vbscript runtime error




"Bob Butler" wrote:

> "frank" wrote in message
> @microsoft.com...
> >
> > Still not working it w
> >
> > works with y: and z: no problem but it not mapping the directory
> >
> > please help
>
> you need to find out what error it is reporting; either take out "On Error
> Resume Next" for now or add code to report what it is trying to map and what
> the error is.
>
> >> oNet.MapNetworkDrive "X:", "\\xyz.com\fs\employee_folder\" & sUserName
>
> msgbox "\\xyz.com\fs\employee_folder\" & sUserName & vbcrlf & err.number &
> ":" & err.description
>
> >> oNet.MapNetworkDrive "Y:", "\\xyz.com\fs\departments"
> >> oNet.MapNetworkDrive "Z:", "\\xyz.com\fs\public"
>
>
>
>
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Wed Oct 03, 2007 1:37 pm    Post subject: Re: login script error Reply with quote

"frank" wrote in message @microsoft.com...
>
> Still not working it w
>
> works with y: and z: no problem but it not mapping the directory
>
> please help

you need to find out what error it is reporting; either take out "On Error
Resume Next" for now or add code to report what it is trying to map and what
the error is.

>> oNet.MapNetworkDrive "X:", "\\xyz.com\fs\employee_folder\" & sUserName

msgbox "\\xyz.com\fs\employee_folder\" & sUserName & vbcrlf & err.number &
":" & err.description

>> oNet.MapNetworkDrive "Y:", "\\xyz.com\fs\departments"
>> oNet.MapNetworkDrive "Z:", "\\xyz.com\fs\public"
Back to top
View user's profile Send private message
frank



Joined: 04 Oct 2007
Posts: 7

PostPosted: Wed Oct 03, 2007 1:31 pm    Post subject: Re: login script error Reply with quote

Still not working it w

works with y: and z: no problem but it not mapping the directory


please help


"Bob Butler" wrote:

> "frank" wrote in message
> @microsoft.com...
> > Bob thank you for the help the only issue it does not map the x: drive
> >
> > it should map a x: to userlogin example I have a test foler it should
> > login
> > to
> > x: \\xyz.com\fs\employee_folder\test
> > but it is not happen
>
> >> > oNet.MapNetworkDrive "X:", "x: \\xyz.com\fs\employee_folder\" &
> >> > sUserName
> >> > oNet.MapNetworkDrive "Y:", "y: \\xyz.com\fs\departments"
> >> > oNet.MapNetworkDrive "Z:", "z: \\xyz.com\fs\public"
>
> oNet.MapNetworkDrive "X:", "\\xyz.com\fs\employee_folder\" & sUserName
> oNet.MapNetworkDrive "Y:", "\\xyz.com\fs\departments"
> oNet.MapNetworkDrive "Z:", "\\xyz.com\fs\public"
>
>
>
Back to top
View user's profile Send private message
Ken Halter



Joined: 04 Oct 2007
Posts: 4150

PostPosted: Wed Oct 03, 2007 2:17 pm    Post subject: Re: login script error Reply with quote

"frank" wrote in message @microsoft.com...
>
> Sorry about that here you go:
>
> Set oNet = CreateObject("WScript.Network")
> Set sUserName = oNet.UserName
>

If 'sUserName' is a string, dump the Set directive.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Wed Oct 03, 2007 2:03 pm    Post subject: Re: login script error Reply with quote

"frank" wrote in message @microsoft.com...
> the error is
> script: \\domain02\netlogon\test.vbs
> line : 2
> char 1
> error object required '[string: "test"]'
> code: 800a01a8
> source: microsoft vbscript runtime error

So what's on line 2 now? In your original post it was blank. People aren't
mind readers, you have to meet us at least half way. With that error I'd
guess that you made a bad edit since the script isn't running at all so
drives Y and Z can't be getting mapped.
Back to top
View user's profile Send private message
frank



Joined: 04 Oct 2007
Posts: 7

PostPosted: Wed Oct 03, 2007 2:14 pm    Post subject: Re: login script error Reply with quote

Sorry about that here you go:

Set oNet = CreateObject("WScript.Network")
Set sUserName = oNet.UserName
oNet.MapNetworkDrive "X:","\\accruent.com\fs\employee_folder\" & sUserName
oNet.MapNetworkDrive "Y:","\\accruent.com\fs\departments"
oNet.MapNetworkDrive "Z:","\\accruent.com\fs\public"

Set oNet = Nothing
"Bob Butler" wrote:

> "frank" wrote in message
> @microsoft.com...
> > the error is
> > script: \\domain02\netlogon\test.vbs
> > line : 2
> > char 1
> > error object required '[string: "test"]'
> > code: 800a01a8
> > source: microsoft vbscript runtime error
>
> So what's on line 2 now? In your original post it was blank. People aren't
> mind readers, you have to meet us at least half way. With that error I'd
> guess that you made a bad edit since the script isn't running at all so
> drives Y and Z can't be getting mapped.
>
>
>
Back to top
View user's profile Send private message
frank



Joined: 04 Oct 2007
Posts: 7

PostPosted: Wed Oct 03, 2007 2:39 pm    Post subject: Re: login script error Reply with quote

now i get the error:

line 3
char 1
the syscannot find the path speciified

code 80070003

Set oNet = CreateObject("WScript.Network")
sUserName = oNet.UserName
oNet.MapNetworkDrive "X:","\\accruent.com\fs\employee_folder\" & sUserName
oNet.MapNetworkDrive "Y:","\\accruent.com\fs\departments"
oNet.MapNetworkDrive "Z:","\\accruent.com\fs\public"
--------
then I tryed

oNet = CreateObject("WScript.Network")
sUserName = oNet.UserName
oNet.MapNetworkDrive "X:","\\accruent.com\fs\employee_folder\" & sUserName
oNet.MapNetworkDrive "Y:","\\accruent.com\fs\departments"
oNet.MapNetworkDrive "Z:","\\accruent.com\fs\public"

and the error is

line 1 char1
error object doesnot support this property or method 'oNet'
code: 800a01b6

----------

"Ken Halter" wrote:

> "frank" wrote in message
> @microsoft.com...
> >
> > Sorry about that here you go:
> >
> > Set oNet = CreateObject("WScript.Network")
> > Set sUserName = oNet.UserName
> >
>
> If 'sUserName' is a string, dump the Set directive.
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> In Loving Memory - http://www.vbsight.com/Remembrance.htm
>
>
>
Back to top
View user's profile Send private message
Jeff Johnson



Joined: 04 Oct 2007
Posts: 1327

PostPosted: Thu Oct 04, 2007 2:26 pm    Post subject: Re: login script error Reply with quote

"frank" wrote in message @microsoft.com...

> now i get the error:
>
> line 3
> char 1
> the syscannot find the path speciified
>
> code 80070003
>
> Set oNet = CreateObject("WScript.Network")
> sUserName = oNet.UserName

WScript.Echo sUserName

Check out what you get for the user name and then make sure that that path
exists.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax 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, 2005 phpBB Group