Rich (Gast) - 15. Dez, 16:30

Parametes

You can handle parameters in a much simpler way. Your subroutine does not need to know the name of the global variable. You can pass it as one of the variables.

Example script, tested under Windows XP.

@echo off
:: Test if the current user is a local adminisrator.

:: Assume the users is not an administrator.
SET ISADMIN=FALSE

::Test current user.
call :ADMINTEST %USERNAME% ISADMIN

echo %ISADMIN%

pause
Goto END
::------------------------------------------------------------------------------
:: This routine will test if the User ID passed in parameter1 is a member
:: of the local administrators group. It will return "TRUE" in parameter 2
:: if the User ID is an admin.
:ADMINTEST
SETLOCAL
net localgroup administrators | find "%1%"
if %ERRORLEVEL% EQU 0 (
ENDLOCAL & SET "%~2=TRUE"
)
GOTO:EOF
::------------------------------------------------------------------------------
:END

Name

Url

Meine Eingaben merken?

Titel:

Text:


JCaptcha - du musst dieses Bild lesen können, um das Formular abschicken zu können
Neues Bild

 

Reflog

Informationstechnische Howtos, Hinweise und Merkwürdiges

Batchlib v1.0 2008-03-29

Aktuelle Beiträge

HOWTO_ O2 DSL Surf &...
Der O2 DSL Surf & Phone-Router ist für die alleinige...
cypressor - 12. Feb, 19:57
Uptweak Windows XP Home...
There are a lot of annoying limitations in Windows...
cypressor - 9. Okt, 19:30
BATCHLIB_ Batchlib package...
Download Batchlib package v1.0 (5 KB zip file) What...
cypressor - 29. Mär, 19:10
BATCHLIB_ Batchlib library...
The batchlib library string.cmd is part of the batchlib...
cypressor - 29. Mär, 18:10

Homepage Ticker

Links

Status

Online seit 6578 Tagen
Zuletzt aktualisiert: 28. Jun, 11:32
RSS XML 1.0 Button-Get-Firefox

batch
batchlib
howto
tech
video
Profil
Abmelden
Weblog abonnieren