---
title: "Inloggnings script!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/windows/79586-inloggnings-script"
topic: "Windows"
topic_url: "https://www.webforum.nu/amne/windows"
author: "webtomten"
published: "2003-06-12T16:29:51.000Z"
updated: "2003-06-19T08:56:03.000Z"
replies: 11
views: 1191
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/windows/79586-inloggnings-script"
---

# Inloggnings script!

## #1 — webtomten, 2003-06-12T16:29Z

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.

Permalänk: https://www.webforum.nu/p/79586

## #2 — stoffe-2k, 2003-06-12T17:24Z

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

Permalänk: https://www.webforum.nu/p/1081915

## #3 — webtomten, 2003-06-12T18:08Z

Hann faktiskt inte söka :r

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

Permalänk: https://www.webforum.nu/p/1081940

## #4 — stoffe-2k, 2003-06-12T18:41Z

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.

Permalänk: https://www.webforum.nu/p/1081951

## #5 — webtomten, 2003-06-13T06:20Z

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?

Permalänk: https://www.webforum.nu/p/1082193

## #6 — mlundbom, 2003-06-13T08:06Z

VB-Script? :)

/M

Permalänk: https://www.webforum.nu/p/1082229

## #7 — stoffe-2k, 2003-06-13T11:12Z

net use lpt2: \\\\server\\skrivarkö

Permalänk: https://www.webforum.nu/p/1082380

## #8 — mlundbom, 2003-06-13T12:30Z

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

Permalänk: https://www.webforum.nu/p/1082422

## #9 — webtomten, 2003-06-14T15:03Z

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

Permalänk: https://www.webforum.nu/p/1082978

## #10 — stoffe-2k, 2003-06-19T08:29Z

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

Permalänk: https://www.webforum.nu/p/1089324

## #11 — SirPeter, 2003-06-19T08:33Z

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

Permalänk: https://www.webforum.nu/p/1089328

## #12 — webtomten, 2003-06-19T08:56Z

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.

Permalänk: https://www.webforum.nu/p/1089340

---

Tråden på webben: https://www.webforum.nu/amne/windows/79586-inloggnings-script
