Dokumentasjon

    Table of Content
    • 3d
      • 3D-filformater
      • 3DS to DWG
      • 3MF to STL
      • AMF
      • FBX to DWG
      • GLB
      • GLB to 3DS
      • GLB to FBX
      • GLB to GLTF
      • GLB to STL
      • GLB to USDZ
      • MTL
      • OBJ
      • PLY
      • STP
    • audio
      • Lydfilformater
      • GP
      • M3U
      • M3U8
      • M4R
      • MP3
      • STY
      • WAV
    • cad
      • CAD-filformater
      • DGN
      • DWFX
      • DWG
      • DXF
      • GCODE
      • IGS
      • PLT
    • compression
      • Komprimeringsfilformater
      • APK
      • GZ
      • ISO
      • LZMA
      • PKG
      • TGS
      • VPK
      • WHL
      • WUX
      • XAPK
      • ZIP
    • data
      • Datafilformater
      • CDX
      • ESX
      • GB
      • INK
      • IO
      • PCB
      • PRT
      • SAFETENSORS
      • VCS
      • XDELTA
    • database
      • Database filformater
      • BAK SQL Server
      • CRYPT14
      • DB
      • DB3
      • DBC
      • DTSX
      • FDB
      • GDB
      • MDF
      • NDF
      • SAV
      • SQL
      • SQLITE
    • disc-and-media
      • Disk- og mediefilformater
      • CUE
      • ISZ
      • MDF
      • OVA
      • TIB
      • Toast
      • WBFS
    • ebook
      • E-bok filformater
      • CBZ
      • JWPUB
      • KFX
    • email
      • Filformater for e-post
      • EML
      • ICS
      • OFT
      • RPMSG
      • VCF
    • executable
      • Kjørbare filformater
      • BAT
      • CMD
      • JSF
      • MST
      • PS1
      • PYC
      • REG
      • RUN
      • WSF
      • XEX
    • finance
      • Finans filformater
      • ABA
      • IXBRL
      • OFX
      • XBRL
    • font
      • Font filformater
      • TTF
      • WOFF2
    • game
      • Spillfilformater
      • ASSET
      • BIN
      • BIN PCSX
      • CLIP
      • CT
      • DSV
      • FOMOD
      • MCA
      • MCPACK
      • NDS
      • NSP
      • NSZ
      • PAK
      • PSS
      • RPF
      • RPX
      • RVZ
      • SMC
      • UASSET
      • Unity3D
      • VDF
      • XCI
      • Z64
    • gis
      • GIS filformater
      • FIT
      • GPX
      • KMZ
    • image
      • Bildefilformater
      • ARW
      • BMP
      • CDR
      • GIF
      • HDR
      • JFIF
      • JPEG
      • JPF
      • JXL
      • PVT
      • RPF
      • SKP
      • TIFF
    • misc
      • Diverse filformater
      • BAK Backup
      • CRX
      • CTG
      • ENC
      • FIG
      • GPG
      • H5
      • IPS
      • LOCK
      • LRC
      • MEDIA FILES
      • NOMEDIA
      • PDO
      • PES
      • PKPASS
      • PS2 BIOS
      • PSX BIOS
      • SHELL SCRIPT
      • TEXT FORMATS
      • XMZX
    • pdf
      • PDF
      • FDF
    • plugin
      • Plugin filformater
      • Q1Q
    • presentation
      • Presentasjonsfilformater
      • PPT
      • PPTX
    • programming
      • Programmering
      • ACD
      • ASM
      • AU3
      • C
      • CONFIG
      • CS
      • CSPROJ
      • CXX
      • EGG
      • G4
      • GROOVY
      • H
      • HPP
      • INO
      • Jav
      • JRXML
    • project-management
      • Prosjektledelse filformater
      • MPP
    1. Hjem
    2. Kjørbare filformater
    3. BAT

    What's on this Page

      • Hva er en BAT-fil?
      • BAT-filformat
        • Batchfilparametere
      • BAT-fileksempel
      • Referanser

    Hva er en BAT-fil?

    En BAT-fil er kjent som en batch-fil som kjører med DOS og alle versjoner av Windows, under cmd.exe. Den består av en serie linjekommandoer i ren tekst som skal utføres av kommandolinjetolken for å utføre forskjellige oppgaver, for eksempel å kjøre vedlikeholdsverktøy i Windows eller starte typiske programmer. En batchfil kan inkludere en hvilken som helst kommando som kan aksepteres av tolken interaktivt og bruke kodestrukturen som muliggjør betinget forgrening og looping som skrevet i batchfilen.

    BAT-filformat

    Et BAT-filformat er ganske enkelt et skript som er innlemmet for å automatisere kommandosekvenser som er repeterende. Begrepet “batch” brukes for batchbehandling, det kan betraktes som “ikke-interaktiv utførelse”. Derfor kan det hende at en batchfil ikke behandler en batch med flere data. I det gamle Disk Operating System (DOS) ble batchfilen kjørt under kommandolinjegrensesnittet ved å skrive inn filnavnet og filtypen .bat. Det tidligere Microsofts grafiske grensesnittbaserte operativsystemet som Microsoft Windows var avhengig av DOS. Brukerne måtte bruke DOS for å utføre typiske operasjoner som å reparere, optimalisere eller installere Windows på nytt. Senere introduserte Microsoft Windows NT som ikke var avhengig av DOS-operativsystemet. Derfor kan batchfilene kjøres ved å bruke kommandoprompt eller cmd.exe i dagens Microsoft-operativsystemer.

    Batchfilparametere

    Ledeteksten støtter en rekke spesielle variabler som %0, %1 til %9 for å referere til navnet og banen til batchjobben og de ni kalleparameterne fra batchjobben. Ikke-eksisterende parametere erstattes av en streng med null lengde. Selv om de kan brukes på samme måte som miljøvariabler, men lagres ikke i miljøet. Microsoft og IBM omtaler disse variablene som erstatningsparametere, mens Novell, Digital Research og Caldera introduserte begrepet erstatningsvariabler for dem.

    Her er noen nyttige batch-filkommandoer:

    CommandDescription
    VERThis batch command shows the version of MS-DOS you are using.
    ASSOCThis is a batch command that associates an extension with a file type (FTYPE), displays existing associations, or deletes an association.
    CDThis batch command helps in making changes to a different directory, or displays the current directory.
    CLSThis batch command clears the screen.
    COPYThis batch command is used for copying files from one location to the other.
    DELThis batch command deletes files and not directories.
    DIRThis batch command lists the contents of a directory.
    DATEThis batch command help to find the system date.
    ECHOThis batch command displays messages, or turns command echoing on or off.
    EXITThis batch command exits the DOS console.
    MDThis batch command creates a new directory in the current location.
    MOVEThis batch command moves files or directories between directories.
    PATHThis batch command displays or sets the path variable.
    PAUSEThis batch command prompts the user and waits for a line of input to be entered.
    PROMPTThis batch command can be used to change or reset the cmd.exe prompt.
    RDThis batch command removes directories, but the directories need to be empty before they can be removed.
    RENRenames files and directories
    REMThis batch command is used for remarks in batch files, preventing the content of the remark from being executed.
    STARTThis batch command starts a program in new window, or opens a document.
    TIMEThis batch command sets or displays the time.
    TYPEThis batch command prints the content of a file or files to the output.
    VOLThis batch command displays the volume labels.
    ATTRIBDisplays or sets the attributes of the files in the curret directory
    CHKDSKThis batch command checks the disk for any problems.
    CHOICEThis batch command provides a list of options to the user.
    CMDThis batch command invokes another instance of command prompt.
    COMPThis batch command compares 2 files based on the file size.
    CONVERTThis batch command converts a volume from FAT16 or FAT32 file system to NTFS file system.
    DRIVERQUERYThis batch command shows all installed device drivers and their properties.
    EXPANDThis batch command extracts files from compressed .cab cabinet files.
    FINDThis batch command searches for a string in files or input, outputting matching lines.
    FORMATThis batch command formats a disk to use Windows-supported file system such as FAT, FAT32 or NTFS, thereby overwriting the previous content of the disk.
    HELPThis batch command shows the list of Windows-supplied commands.
    IPCONFIGThis batch command displays Windows IP Configuration. Shows configuration by connection and the name of that connection.
    LABELThis batch command adds, sets or removes a disk label.
    MOREThis batch command displays the contents of a file or files, one screen at a time.
    NETProvides various network services, depending on the command used.
    PINGThis batch command sends ICMP/IP “echo” packets over the network to the designated address.
    SHUTDOWNThis batch command shuts down a computer, or logs off the current user.
    SORTThis batch command takes the input from a source file and sorts its contents alphabetically, from A to Z or Z to A. It prints the output on the console.
    SUBSTThis batch command assigns a drive letter to a local folder, displays current assignments, or removes an assignment.
    SYSTEMINFOThis batch command shows configuration of a computer and its operating system.
    TASKKILLThis batch command ends one or more tasks.
    TASKLISTThis batch command lists tasks, including task name and process id (PID).
    XCOPYThis batch command copies files and directories in a more advanced way.
    TREEThis batch command displays a tree of all subdirectories of the current directory to any level of recursion or depth.
    FCThis batch command lists the actual differences between two files.
    DISKPARTThis batch command shows and configures the properties of disk partitions.
    TITLEThis batch command sets the title displayed in the console window.
    SETDisplays the list of environment variables on the current system.

    BAT-fileksempel

    Batch-skript lagres vanligvis som enkle tekstfiler; som inneholder kommandoer som blir utført i en sekvens. Disse filene er lagret med filtypen .bat; gjenkjent og utført ved å bruke Command Interpreter programvare. Denne programvaren er naturlig tilgjengelig i Microsoft Windows med navnet cmd.exe.

    Her er et eksempel på batchskript som sletter alle filene i gjeldende katalog:

    :: Deletes All files in the Current Directory With Prompts and Warnings
    ::(Hidden, System, and Read-Only Files are Not Affected)
    :: @ECHO OFF
    DEL . DR
    

    Referanser

    • Batch Script - Quick Guide
    • Batch file - by Wikipewdia

    See Also

    • FOMOD - Fallout Mod Archive File
    • PSS - PlayStation 2 Game Video File
    • REG - Windows Registry File
    • PES-filformat - Brother PE-broderiformat
    • CMD - Windows Command File Format
     
     Norsk
    Close
     English
     Deutsch
     日本
     中文
     русский
     Français
     한국인
     Español
     Italiano
     Nederlands
     हिन्दी
     Indonesian
     Português
     عربي
     Türkçe
     Ελληνικά
     ไทย
     עִברִית
     Svenska
     українська
     Tiếng Việt
     български
     Magyar
     čeština
     Română
     Polski
     Bengali
     Dansk
     Persian
     Finnish
     Gaeilge
     Lithuanian
     Latvian
     Azeri
     Filipino