PC Review


Reply
Thread Tools Rate Thread

cmd-Programm

 
 
Peter Mairhofer
Guest
Posts: n/a
 
      23rd Feb 2006
Hallo,

In unserem netlogon-script werden etliche Freigaben verbunden, darunter
auch solche, auf die nicht jeder Zugriff hat.

Bei diesen "steckt" das die logon.cmd und verlangt nach Benutzernamen und
Passwort. Das ist natuerlich ein grosses Problem.

Jetzt will ich das Netzlaufwerk nur verbinden, wenn der Benutzer Zugriff
drauf hat.

Eine Moeglichkeit, fuer den Fall dass ich UNIX-Befehle zu Verfuegung hab
bzw. Cygwin installiert ist (ist leider nicht auf allen Stationen
installiert) waere das simple Script:

NET VIEW \\SERVER | grep office
IF %ERRORLEVEL% == 0 NET USE O: \\SERVER\office

grep durchsucht dabei den Input von stdin nach dem Wort 'office'; wird es
gefunden, ist der return-Wert 0, sonst ungleich 0.

Gibt es eine Moeglichkeit das mit reinen Windows-Mitteln umzusetzen bzw.
ueberhaupt eine andere Moeglichkeit fuer das Problem?

vielen dank
peter


 
Reply With Quote
 
 
 
 
Malke
Guest
Posts: n/a
 
      23rd Feb 2006
Peter Mairhofer wrote:

> Hallo,
>
> In unserem netlogon-script werden etliche Freigaben verbunden,
> darunter auch solche, auf die nicht jeder Zugriff hat.


(snip post not in English)

Please look for a newsgroup that is for your native language and post
there. Here is a list of all the MS newsgroups:

http://aumha.org/nntp.htm

This way you will be sure to get accurate help without any language
difficulties that might cause errors.

Malke
--
Elephant Boy Computers
www.elephantboycomputers.com
"Don't Panic!"
MS-MVP Windows - Shell/User
 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a
 
      23rd Feb 2006
Hi,

Try this in your logon.cmd file, it uses only built-in OS
tools (nur reinen Windows-Mitteln umzusetzen):


--------------------8<----------------------

set OfficeFound=N
for /f "Tokens=*" %%b in ('NET.exe VIEW \\SERVER ^| FIND.exe /i "office"') do (
set OfficeFound=Y
)

if "%OfficeFound%" EQU "Y" NET.exe USE O: \\SERVER\office

--------------------8<----------------------


Regards,
Torgeir


Peter Mairhofer wrote:
> Hallo,
>
> In unserem netlogon-script werden etliche Freigaben verbunden, darunter
> auch solche, auf die nicht jeder Zugriff hat.
>
> Bei diesen "steckt" das die logon.cmd und verlangt nach Benutzernamen und
> Passwort. Das ist natuerlich ein grosses Problem.
>
> Jetzt will ich das Netzlaufwerk nur verbinden, wenn der Benutzer Zugriff
> drauf hat.
>
> Eine Moeglichkeit, fuer den Fall dass ich UNIX-Befehle zu Verfuegung hab
> bzw. Cygwin installiert ist (ist leider nicht auf allen Stationen
> installiert) waere das simple Script:
>
> NET VIEW \\SERVER | grep office
> IF %ERRORLEVEL% == 0 NET USE O: \\SERVER\office
>
> grep durchsucht dabei den Input von stdin nach dem Wort 'office'; wird es
> gefunden, ist der return-Wert 0, sonst ungleich 0.
>
> Gibt es eine Moeglichkeit das mit reinen Windows-Mitteln umzusetzen bzw.
> ueberhaupt eine andere Moeglichkeit fuer das Problem?
>
> vielen dank
> peter
>
>



--
torgeir, Microsoft MVP Scripting, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
un known programm =?Utf-8?B?c2NvdHR5bnoyNQ==?= Windows XP New Users 1 9th Jan 2006 08:12 PM
GPS Map Programm?? Bastiaan Hurkmans Freeware 2 13th Jul 2004 10:26 AM
Dos programm Erau Windows XP Basics 7 3rd Apr 2004 06:37 PM
Programm uses 90% of the CPU Tobias Ulm Microsoft Dot NET Framework Forms 2 23rd Jan 2004 04:58 PM
How to run DOS programm colombo Microsoft Windows 2000 1 12th Sep 2003 07:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:46 PM.