Page 1 of 1 1
Topic Options
#144425 - 2005-07-28 05:44 AM script to map to network drive
oscar Offline
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
#144426 - 2005-07-28 05:56 AM Re: script to map to network drive
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Hello and welcome to the board

Using KiXtart



USE G: '\\SERVER\SHARE'

 
That's all there is to it.

If you want to be group conditional about it then like this.

If InGroup('MyDomain\MyGroup')
 USE G: '\\SERVER\SHARE'
EndIf
 

Top
#144427 - 2005-07-28 05:57 AM Re: script to map to network drive
Bryce Offline
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 Offline
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 Offline
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.
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#144430 - 2005-07-29 03:53 AM Re: script to map to network drive
oscar Offline
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
#144431 - 2005-07-29 12:44 PM Re: script to map to network drive
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You could try Shutdown() with the reboot option.
Top
#144432 - 2005-07-30 01:09 AM Re: script to map to network drive
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#144433 - 2005-07-30 03:05 AM Re: script to map to network drive
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
AFAIK, Hyena is not shareware and must be licensed.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144434 - 2005-07-30 03:44 AM Re: script to map to network drive
NTDOC Administrator Offline
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
#144435 - 2005-07-31 04:50 PM Re: script to map to network drive
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hyena is shareware.
_________________________
!

download KiXnet

Top
#144436 - 2005-08-02 01:23 AM Re: script to map to network drive
oscar Offline
Fresh Scripter

Registered: 2005-07-28
Posts: 17
thanks for all the info, it's really helping
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.064 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org