webForumDet fria alternativet

Inloggnings script!

Windowsur Windows

11 svar · 1 166 visningar · startad av webtomten

Medlem sedan apr. 20003 424 inlägg
Frågan#1

Det är så att jag har bestämt mig för att testa AD på win2k server. Innan körde vi så att man loggade in lokalt på sin dator och sedan fick man ansluta genom nätverket. Men nu vill jag testa AD.

Och då har jag en fråga :)

Hur gör man ett inloggnings script?
Ett sånt som ansluter nätverksenheter samt skrivare m.m. så fort man loggar in.

Medlem sedan apr. 200010 782 inlägg
#2

Sökt i forumet :q :p

Här kommer ett script som är för båda NT och win9x miljö.

@echo off

@echo Stoffe-2k Rockar!

@if "%OS%" == "Windows_NT" goto NT_OS

net use h: /HOME

net use s: \\Server\mapp

net time \\Server /set /yes

@goto END

:NT_OS

net use h: /HOME persistent:no

net use s: \\Server\mapp /persistent:no

net time \\Server /set /yes

@echo on

:END

typ :e

Medlem sedan apr. 20003 424 inlägg
#3

Hann faktiskt inte söka :r

Du vet inte var man kan hitta information om detta vad som gör vad etc? :)

Medlem sedan apr. 200010 782 inlägg
#4

NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]

NET USE connects a computer to a shared resource or disconnects a
computer from a shared resource. When used without options, it lists
the computer's connections.

devicename Assigns a name to connect to the resource or specifies
the device to be disconnected. There are two kinds of
devicenames: disk drives (D: through Z:) and printers
(LPT1: through LPT3:). Type an asterisk instead of a
specific devicename to assign the next available
devicename.
\\computername Is the name of the computer controlling the shared
resource. If the computername contains blank characters,
enclose the double backslash (\\) and the computername
in quotation marks (" "). The computername may be from
1 to 15 characters long.
\sharename Is the network name of the shared resource.
\volume Specifies a NetWare volume on the server. You must have
Client Services for Netware (Windows Workstations)
or Gateway Service for Netware (Windows Server)
installed and running to connect to NetWare servers.
password Is the password needed to access the shared resource.
* Produces a prompt for the password. The password is
not displayed when you type it at the password prompt.
/USER Specifies a different username with which the connection
is made.
domainname Specifies another domain. If domain is omitted,
the current logged on domain is used.
username Specifies the username with which to logon.
/SMARTCARD Specifies that the connection is to use credentials on
a smart card.
/SAVECRED Specifies that the username and password are to be saved.
This switch is ignored unless the command prompts for username
and password. This option is not available on Windows XP
Home Edition and will be ignored.
/HOME Connects a user to their home directory.
/DELETE Cancels a network connection and removes the connection
from the list of persistent connections.
/PERSISTENT Controls the use of persistent network connections.
The default is the setting used last.
YES Saves connections as they are made, and restores
them at next logon.
NO Does not save the connection being made or subsequent
connections; existing connections will be restored at
next logon. Use the /DELETE switch to remove
persistent connections.
NET HELP command | MORE displays Help one screen at a time.

Medlem sedan apr. 20003 424 inlägg
#5

Men hur ansluter man en skrivare?
Jag får det inte att funka.

Skrivaren har en egen printerserver. Men den delas ut från servern.

Samt om man vill att olika användare ska få olika mappar?

Är det lättast att skapa fler script då eller går det att lösa på nått annat sätt?

Medlem sedan jan. 2003573 inlägg
#6

VB-Script? :)

/M

Medlem sedan apr. 200010 782 inlägg
#7

net use lpt2: \\server\skrivarkö

Medlem sedan jan. 2003573 inlägg
#8

Tss, det installerar ju inte drivrutinen :-)

För .vbs:
Dim WshNetwork
set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\SERVER\PRINTERSHARE"

För .cmd:
RunDll32 printui.dll,PrintUIEntry /in /n "\\SERVER\PRINTERSHARE"
(lägg till /y om den ska bli standardskrivare)

/M

Medlem sedan apr. 20003 424 inlägg
#9

Får det inte att funka :(

allt utom skrivaren fungerar.

Någon som vet vad som kan vara fel? Jag kör med Stoffe-2k exmeple längre upp och har både testat stoffes samt mlundboms script för skirvare. använder mig av .cmd

Medlem sedan apr. 200010 782 inlägg
#10

Fungerar inte på vilka klienter NT eller 9x? fel koder/utskrifter loggar?

Medlem sedan feb. 200115 571 inlägg
#11

Scriptet som mlundbom skrev fungerar iaf med ett 2000-system helt klart då vi har kört med exakt samma i ett par år.

Medlem sedan apr. 20003 424 inlägg
#12

så här ser scriptet ut:

@echo off 

@echo UFM Inloggning! 

@if "%OS%" == "Windows_NT" goto NT_OS 

RunDll32 printui.dll,PrintUIEntry /in /n /y "\\ufm-server\BrotherH"

net use y: \\ufm-server\SPCS

net use f: \\ufm-server\UFM

net use g: \\ufm-server\Peak24

net time \\ufm-server /set /yes 

@goto END 

:NT_OS 

RunDll32 printui.dll,PrintUIEntry /in /n /y "\\ufm-server\BrotherH"

net use y: \\ufm-server\SPCS /persistent:no 

net use f: \\ufm-server\UFM /persistent:no

net use g: \\ufm-server\Peak24 /persistent:no

net time \\ufm-server /set /yes 

@echo on 

:END

Och jag får inga felmeddelanden i loggen eller i commando tolken.

139 ms totalt · 3 externa anrop · v20260731065814-full.232057fb
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
135 ms — hämta tråd, inlägg och bilagor (db)