Projekat

Općenito

Profil

DOS command prompt

1) dir

Lista sadržaj direktorija

primjer dir-a

C:\sigma\VIRM>dir

 Volume in drive C has no label.
 Volume Serial Number is F880-75C2

 Directory of C:\sigma\VIRM

22.07.2010  13:39    <DIR>          .
22.07.2010  13:39    <DIR>          ..
22.07.2010  12:50    <DIR>          11
22.07.2010  13:47    <DIR>          12
25.03.2010  17:54    <DIR>          21
22.07.2010  13:39    <DIR>          22
22.07.2010  13:39             5.120 KORISN.CDX
22.10.2010  13:36             1.186 KORISN.DBF
25.03.2010  17:59             5.120 MPARAMS.CDX
25.03.2010  17:59               259 MPARAMS.DBF
               4 File(s)         11.685 bytes
               6 Dir(s)  32.840.970.240 bytes free

Moguće opcije dir komande

C:\sigma\VIRM>dir /?

Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
  [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

  [drive:][path][filename]
              Specifies drive, directory, and/or files to list.

  /A          Displays files with specified attributes.
  attributes   D  Directories                R  Read-only files
               H  Hidden files               A  Files ready for archiving
               S  System files               -  Prefix meaning not
  /B          Uses bare format (no heading information or summary).
  /C          Display the thousand separator in file sizes.  This is the
              default.  Use /-C to disable display of separator.
  /D          Same as wide but files are list sorted by column.
  /L          Uses lowercase.
  /N          New long list format where filenames are on the far right.
  /O          List by files in sorted order.
  sortorder    N  By name (alphabetic)       S  By size (smallest first)
               E  By extension (alphabetic)  D  By date/time (oldest first)
               G  Group directories first    -  Prefix to reverse order

  /W          Uses wide list format.
  /X          This displays the short names generated for non-8dot3 file
              names.  The format is that of /N with the short name inserted
              before the long name. If no short name is present, blanks are
              displayed in its place.
  /4          Displays four-digit years

Switches may be preset in the DIRCMD environment variable.  Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

2) cd

cd\ Goes to the highest level, the root of the drive.
Npr.

C:\windows\system32>cd\
C:\>

cd.. Goes back one directory.
Npr.

        C:\WINDOWS>cd..
        C:\>

cd Goes to specific directory.
Npr.

        C:\>cd windows
        C:\windows>

3) del

delete fajl

DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] name

/P    Prompts for confirmation before deleting each file.
/F    Force deleting of read-only files.
/S    Delete specified files from all subdirectories.
/Q    Quiet mode, do not ask if ok to delete on global wildcard
/A    Selects files to delete based on attributes
attributes:
R Read-only files, S System files, H Hidden files, A Files ready for archiving

Npr.

c:\>del /p emir.txt
c:\emir.txt, Delete (Y/N)?
C:\>del /a:h emir.txt

4) ren

rename fajl
Npr.

c:\>rename emir.txt emir123.txt
c:\>rename emir.txt emir.bat

5) mkdir

Koristi se za kreiranje novog direktorija
mkdir name
Npr.

c:\>mkdir emir
c:\>cd emir
c:\emir>mkdir emir123
c:\emir>cd emir123
c:\emir\emir123>

6) rmdir

remove direktorij (mora biti prazan)
Npr.

c:\>rmdir emir

C:\>mkdir emir
C:\>cd emir
C:\emir>cd..
C:\>cd emir
C:\emir>mkdir emir1
C:\emir>cd..
C:\>rmdir emir
The directory is not empty.

7) echo

prikaz varijable:

npr: echo PATH

C:\windows>cd\
C:\>echo %path%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common
Files\Autodesk Shared\;C:\Program Files\MySQL\MySQL Server 5.5\bin;c:\sigma

8) pause

zaustavlja izvršenje batch skripte

9) set (environment varijable: PATH i sl.)

set PATH=%PATH%;c:\sigma
echo %PATH%

Gornja komanda dodaje c:\sigma u PATH environment varijablu

nakon toga štampa novu verziju PATH environment varijable

komanda set bez parametara lista sve predefinisane environmnent varijable

wikipedia: primjeri DOS environmentvarijabli