Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

force disconnection

Status
Not open for further replies.

Bob2

Programmer
Jul 3, 2000
228
0
0
SE
Hi


I need a script or someother way to force a disconection from a share on my win 2000 server. It has to work even if the user is connected and have files open from the share. It also has to work with both win & mac clients.

Could someone please help me out here?



Regards

M
 
Hi


Yes it seem to be terrific recource, where exactly do I find the one I was looking for?



Cheers


M
 
I just had a look throuh the list of pre-written batch files they have on that site, as i feared they don;t have an script for what you need to do, sorry bud.

Keep it in mind for future reference though.

may i ask why you wish this forced disconnection?
 
I allreaady have a script, but if users have files opened from the share, I can't disconnect them.

And I need to do that beacuse I run a script that delete all files on that network share every night.


Regards


M
 
ah ok, i have a script that will for a client "loggoff, shutdown or re-start if thats any good?
you may be able to modifly t to disconnect them, these scrpits will do this irrespective of weather there are files open or not. let me know if they are any use.
 
Hi


That really sound like a good script that could come handy. If I could do that then I can use that together with my own script to get it to work.

Yes I definitly want that script.


Regards


M
 
Sure Bud,

rem start of script
@ Echo Off
shutdown -r -m \\sales1 -t 60 -c "Your logon session has expired. This workstation is shutting down." -f
rem Script Ends

Parameters:

-r Tells Windows to do a restart
"replace r with s for a shutdown command, or l for lofoff i believe!"
-m Name of the remote machine
-t How long the countdown is
-c Custom messatge
-f Forceful. System will close regardless of open applications

Let me know how you get on, also if you do modify the script it would be great to get a copy of the modified one, never know when that stuff comes in handy.

Cheers mate.
 
Hi


Thanks for the script, but if I understand this right, only windows 2000 and win nt 4 clients will be affected by this. And that is not enough.

I will have to use the net stop server command insted.


Regards

M
 
Err, we have win XP Pro clients that seem to work fine when we run the script, you just have to do one thing that i forgot about, you need to copy a shutdown.exe file into the directory on the win2k server.

You can find the shutdown.exe file in your WinXP drectory on a XP client, or it is available for download on the net.

You must then place it into the WINNT/System32 directory.

This should do the business.
 
Hi again


Well, we have MAC does the script work for them too?



/M
 
I only have on mac, and its not co nnected to the central main frame, i would imagine that it does, if you manage to have access to the domain from the mac you should be able to run these commands.

Give is a go, it certainly wont do any harm!
 
How do I apply the above script to run at a certain time every night through Group Policy?
 
As far as I know, group policy only gives you scripts at Startup, Shutdown, Logon, & Logoff. I doesn't allow for scheduling. To schedule a script for certain times of the day use the Windows scheduler.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top