Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

computer startup script - error 1219 with net use command

443 views
Skip to first unread message

JR

unread,
Nov 30, 2007, 7:35:02 PM11/30/07
to
Hi,
I am trying to write a computer startup script to run a .exe on
everybody's computer, but when I try to map a drive with the net use
command, I keep getting the following error:

"System error 1219 has occurred.
Multiple connections to a server or shared resource by the same user,
using more than one user name, are not allowed. Disconnect all
previous connections to the server or shared resource and try again.."

I was first using the domain admin account, then created a service
account just for this, and still got the same error.

My script looks like something this:


net use * /del
net use J: "\\server\share\path" password /u:domain\user *error
occurs here*
cd \
J:
J:\program.exe
net use J: /del
EXIT


Machines are XP, server is 2003 SBS. Everything up to date.

Can anybody tell me why I keep getting this error? Any help would be
much appreciated!

Pegasus (MVP)

unread,
Dec 1, 2007, 2:04:00 AM12/1/07
to

"JR" <joshr...@hotmail.com> wrote in message
news:b204c326-ad3c-41a1...@s19g2000prg.googlegroups.com...

Why do you specify a user account / password in the problem line?


Chris M

unread,
Dec 3, 2007, 6:01:10 AM12/3/07
to
JR wrote:
> Hi,
> I am trying to write a computer startup script to run a .exe on
> everybody's computer, but when I try to map a drive with the net use
> command, I keep getting the following error:

That won't work. Startup scripts run in the context of the local SYSTEM
account.

Even if the drive mapping was successful, it would disappear when a user
logged on - network drives are mapped on a per-user basis.

The solution is to use a logon script instead (you may have to use
loopback processing to get it to work, depending on where you want the
policy to apply).

You won't need to specify any explicit credentials since a logon script
will run in the context of the user who is logging on.

Cheers,


--
Chris M.

Remove pants to email me.

Chris M

unread,
Dec 3, 2007, 6:04:14 AM12/3/07
to
JR wrote:
> Hi,
> I am trying to write a computer startup script to run a .exe on
> everybody's computer, but when I try to map a drive with the net use
> command, I keep getting the following error:

Sorry, I've just re-read your post and noticed that you only want to run
an exe at startup.

In that case, you don't even need to script it.

Put the executable into the Machine startup folder in the group policy
object (in the SYSVOL share) and just run it directly from there.

Pegasus (MVP)

unread,
Dec 3, 2007, 6:09:01 AM12/3/07
to

"Chris M" <Ne...@mckeownpants-online.com> wrote in message
news:fj0nls$nh2$1...@aioe.org...

> JR wrote:
>> Hi,
>> I am trying to write a computer startup script to run a .exe on
>> everybody's computer, but when I try to map a drive with the net use
>> command, I keep getting the following error:
>
> That won't work. Startup scripts run in the context of the local SYSTEM
> account.
>

Sorry, this is incorrect. Startup scripts run in the context
of the user who is logging on. You can see it for yourself
by inserting these lines into your script:
echo User=%UserName%
pause


Chris M

unread,
Dec 3, 2007, 6:19:39 AM12/3/07
to


A startup script runs when the computer starts up. It'll run even if
nobody logs on. What is the user context in that case?

The logon/logoff scripts run as the user who is logging on/off.

Chris M

unread,
Dec 3, 2007, 6:23:25 AM12/3/07
to

For further clarification:

"Startup scripts run as Local System and have the full rights required
to run as Local System."

From here:

http://technet2.microsoft.com/Office/en-us/library/a57c8446-b959-4025-a866-b690ddcaa66d1033.mspx?mfr=true

Pegasus (MVP)

unread,
Dec 3, 2007, 6:56:39 AM12/3/07
to

"Chris M" <Ne...@mckeownpants-online.com> wrote in message
news:fj0ovg$qpm$2...@aioe.org...

You're right - I mixed up startup and logon scripts.


JR

unread,
Dec 3, 2007, 3:22:57 PM12/3/07
to

Oh, so instead of putting the .bat file into that group policy object,
I just need to put the .exe itself? Thanks, I'll try that.

0 new messages