IZBORNIK HOME FORUM ACCESS EXCEL WORD  
 

HOME

   
1 UVOD
2 CMD sintaksa i XP naredbeni interpreter
3 Parametri i Prekidači
4 Kretanje pomoću tipki
5 Podešavanje prozora
6 Zamjenski znakovi
7 Editiranje TXTdatoteka
8 Posebni simboli u CMD naredbi
9 BATCH datoteke u CMD
10 HELP u CMD prozoru
11 ERROR u CMD prozoru
 

-- NAREDBE U  CMD-u --

  ASSOC
  AT
  ATTRIB
  BREAK
  CACLS
  CALL
  CD
  CHCP
  CHDIR
  CHKDSK
  CHKNTFS
  CLS
  CLIP
  CMD
  COLOR
  COMP
  COMPACT
  CONVERT
  COPY
  DATE
  DEL
  DIR
  DISKCOMP
  DISKCOPY
  DOSKEY
  ECHO
  ENDLOCAL
  ERASE
  EXIT
  FC
  FIND
  FINDSTR
  FOR
  FORMAT
  FTYPE
  GOTO
  GRAFTABL
  HELP
  IF
  LABEL
  MD
  MKDIR
  MODE
  MORE
  MOVE
  PATH
  PAUSE
  POPD
  PRINT
  PROMPT
  PUSHD
  RD
  RECOVER
  REM
  REN
  RENAME
  REPLACE
  RMDIR
  SET
  SETLOCAL
  SHIFT
  SORT
  START
  SUBST
  TIME
  TITLE
  TREE
  TYPE
  VER
  VERIFY
  VOL
  XCOPY
   
   
12 PING
13 IPCONFIG
14 NETSTAT
15 ROUTE
16 NSLOOKUP
17 ARP
18 TRACERT
19 TELNET
20 NET Commands
   
  .

NAREDBENO SUČELJE (Command Prompt line)

LABEL Search This Web Site

Adsense sponzor



 




SETLOCAL

Starts localization of environment variables in a batch file. Localization continues until a matching endlocal command is encountered or the end of the batch file is reached.

Syntax

setlocal {enableextension | disableextensions} {enabledelayedexpansion | disabledelayedexpansion}

Arguments

enableextension

Enables the command extensions until the matching endlocal command is encountered, regardless of the setting prior to the setlocal command.

disableextensions

Disables the command extensions until the matching endlocal command is encountered, regardless of the setting prior to the setlocal command.

enabledelayedexpansion

Enables the delayed environment variable expansion until the matching endlocal command is encountered, regardless of the setting prior to the setlocal command.

disabledelayedexpansion

Disables the delayed environment variable expansion until the matching endlocal command is encountered, regardless of the setting prior to the setlocal command.

/?

Displays help at the command prompt.

Remarks

  • Using setlocal

When you use setlocal outside of a script or batch file, it has no effect.

  • Changing environmental variables

Use setlocal to change environment variables when you run a batch file. Environment changes made after you run setlocal are local to the batch file. Cmd.exe restores previous settings when it either encounters an endlocal command or reaches the end of the batch file.

  • You can have more than one setlocal or endlocal command in a batch program (that is, nested commands).
  • Testing for command extensions in batch files

The setlocal command sets the ERRORLEVEL variable. If you pass either {enableextension | disableextensions} or {enabledelayedexpansion | disabledelayedexpansion}, the ERRORLEVEL variable is set to zero (0). Otherwise, it is set to one (1). You can use this in batch scripts to determine whether the extensions are available, for example:

    verify other 2>nul

    setlocal enableextensions

    if errorlevel 1 echo Unable to enable extensions

Because cmd does not set the ERRORLEVEL variable when command extensions are disabled, the verify command initializes the ERRORLEVEL variable to a nonzero value when you use it with an invalid argument. Also, if you use the setlocal command with arguments {enableextension | disableextensions} or {enabledelayedexpansion | disabledelayedexpansion} and it does not set the ERRORLEVEL variable to one (1), command extensions are not available.

For more information about enabling and disabling command extensions, see cmd in Related Topics.

Examples

You can localize environment variables in a batch file, as follows:

  rem *******Begin Comment**************
  rem This program starts the superapp batch program on the network,
  rem directs the output to a file, and displays the file
  rem in Notepad.
  rem *******End Comment**************
      @echo off
      setlocal
      path=g:\programs\superapp;%path%
      call superapp>c:\superapp.out
      endlocal
      start notepad c:\superapp.out

Adsense sponzor



Adsense sponzor



 




Copyright 2009 - IvanC - ic.ims.hr