#144425 - 2005-07-28 05:44 AM
script to map to network drive
|
oscar
Fresh Scripter
Registered: 2005-07-28
Posts: 17
|
Ok, im sure everyone has mapped to a network drive before. I only know of 2 ways to do this.
1. Through "my computer", click map network drive. 2. through the start menu: click run, type--> \\"computer name"\c$
Can anyone tell me how to write a script to do the second one. If not, how about the first . Thanks
|
Top
|
|
|
|
#144427 - 2005-07-28 05:57 AM
Re: script to map to network drive
|
Bryce
KiX Supporter
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
from a command prompt net use * \\server\sahre
or, kix code
Code:
use * "\\server\share"
Might want to take a gander manual.
|
Top
|
|
|
|
#144428 - 2005-07-28 06:16 AM
Re: script to map to network drive
|
oscar
Fresh Scripter
Registered: 2005-07-28
Posts: 17
|
u guys rock, thanks , ill try it out tomorrow.
|
Top
|
|
|
|
#144429 - 2005-07-28 05:27 PM
Re: script to map to network drive
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
One thing to keep in mind, however: Code:
\\"computer name"\c$
Any of the c$, d$, admin$, etc. are all Administrative Shares and common users cannot map drives to them.
|
Top
|
|
|
|
#144430 - 2005-07-29 03:53 AM
Re: script to map to network drive
|
oscar
Fresh Scripter
Registered: 2005-07-28
Posts: 17
|
anyone know how to logoff a remote machine? i tried and logged myself off. i used: $RC = LOGOFF(1) ?????
|
Top
|
|
|
|
#144432 - 2005-07-30 01:09 AM
Re: script to map to network drive
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Couple of things to try..
Install the ADMINPAK.MSI from one of your DCs and use "Terminal Services Manager" from Administrative Tools in your Control Panel to connect to any system and choose logoff. If logoff doesn't work, choose reset.
You can also use Hyena (Shareware) to do the same thing.
HTH,
Kent
|
Top
|
|
|
|
#144434 - 2005-07-30 03:44 AM
Re: script to map to network drive
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Can you say FREEWARE Quote:
PsShutdown is a command-line utility similar to the shutdown utility from the Windows 2000 Resource Kit, but with the ability to do much more. In addition to supporting the same options for shutting down or rebooting the local or a remote computer, PsShutdown can logoff the console user or lock the console (locking requires Windows 2000 or higher). PsShutdown requires no manual installation of client software.
PsShutdown
Installation Just copy PsShutdown onto your executable path, and type psshutdown with command-line options defined below.
PsShutdown works on NT 4.0 and higher.
Usage You can use PsShutdown to initiate a shutdown of the local or a remote computer, logoff a user, lock a system, or to abort an imminent shutdown.
usage: psshutdown [[\\computer[,computer[,..] | @file [-u user [-p psswd]]] -s|-r|-h|-d|-k|-a|-l|-o [-f] [-c] [-t nn|h:m] [-n s] [-e [u|p]:xx:yy] [-m "message"]
For the entire suite of PsTools check them out here PsTools Quote:
The tools included in the PsTools suite, which are downloadable individually or as a package, are:
PsExec - execute processes remotely PsFile - shows files opened remotely PsGetSid - display the SID of a computer or a user PsKill - kill processes by name or process ID PsInfo - list information about a system PsList - list detailed information about processes PsLoggedOn - see who's logged on locally and via resource sharing (full source is included) PsLogList - dump event log records PsPasswd - changes account passwords PsService - view and control services PsShutdown - shuts down and optionally reboots a computer PsSuspend - suspends processes PsUptime - shows you how long a system has been running since its last reboot (PsUptime's functionality has been incorporated into PsInfo) All of the utilities in the PsTools suite work on Windows NT, Windows 2000, Windows XP and Windows Server 2003. The PsTools download package includes an HTML help file with complete usage information for all the tools.
|
Top
|
|
|
|
#144436 - 2005-08-02 01:23 AM
Re: script to map to network drive
|
oscar
Fresh Scripter
Registered: 2005-07-28
Posts: 17
|
thanks for all the info, it's really helping
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 382 anonymous users online.
|
|
|