Link to home
Start Free TrialLog in
Avatar of myxiplx
myxiplx

asked on

Startup Script - 'Net Use /delete' leaves disconnected drive available to users

Hi folks,

I'm trying to put together a startup script to install an application on our network.  Please note that this is not a login script:  it is assigned to the computer as a startup script, allowing the script to run under the local system account.

The script is esentially a batch file, called by a Group Policy object, which passes the admin account password as a parameter:
net use y: \\server\share /user:domain\adminaccount %1
setup.exe
net use y: /delete /user:domain\adminaccount %1

The script runs fine and the program installs but the network drive does not disconnect correctly.  Instead, when the user opens My Computer, the drive is visible as 'Disconnected Network Drive (Y:)'.  This drive cannot be disconnected, it gives the error 'The network connection could not be found'.  Despite appearing as a disconnected drive, if the user has permissions to the target folder, it can be opened and browsed the same as any other working network drive.

I guess I'm looking either for a way to correctly disconnect this drive in the startup script, or else find a way to run this as a login script as I'm confident the drive would disconnect normally then (this would need elevated permissions though in order for the program to install correctly).

I'm on a Windows 2000 domain and am using Group Policy to assign this script.  All of our clients are either Windows 2000 or XP.

Ross

P.S.  I think they need a new question category for this one:  'This question is not urgent but is extremely annoying!'
Avatar of myxiplx
myxiplx

ASKER

Sorry, please ignore this question, I've just solved it.

instead of:
net use y: /delete /user:domain\adminaccount %1

I'm now using:
net use y: /delete

Which seems to work :-)
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial