Cov txheej txheem:

Kev Qhia Ua Batch Basic Heev: 6 Kauj Ruam
Kev Qhia Ua Batch Basic Heev: 6 Kauj Ruam

Video: Kev Qhia Ua Batch Basic Heev: 6 Kauj Ruam

Video: Kev Qhia Ua Batch Basic Heev: 6 Kauj Ruam
Video: yuav coj li cas kom luag nyiam 2024, Kaum ib hlis
Anonim
Basic Batch Tutorial heev
Basic Batch Tutorial heev

Yog tias koj twb paub qhov tseem ceeb ntawm Batch koj tsis tas yuav tsum nyeem cov ntawv qhia no txuas ntxiv mus Tsis Yog Li Qhib Cov Qauv Qhia. uas koj yuav tsum tsuas yog ntaus ntawv: piv txwv)

Kauj ruam 1: Yog li, Dab tsi yog Batch

Rau cov uas tsis paub, Batch file yog cov ntawv sau uas muaj cov lus txib kom ua tiav los ntawm Command Prompt (CMD). Thaum ib daim ntawv ua tiav, CMD nyeem cov ntawv thiab ua nws cov lus txib. Txhawm rau qhib koj li CMD, nyem START> RUN> hom "CMD"> OK (qee qhov koj yuav xav tau ntaus "CMD. EXE") (lossis koj tuaj yeem ua tau nyem START> TXHUA YAM NTAWV> ACCESSORIES> COMMAND PROMPT).

Kauj ruam 2: Tam sim no Dab tsi?

Nov yog qee qhov lus txib tseem ceeb koj yuav tsum paub: (thov sim qee qhov ntawm cov lus txib hauv koj li CMD).@Ncha tawm - Qhov no tshem tawm qhov ntawd "c: / cov ntaub ntawv … etc" ncha - Qhov no qhia cov lus, (piv txwv li "ncha nyob zoo" = "nyob zoo") vim hais tias yog koj ntaus "nyob zoo" rau hauv CMD nws yuav txhais "nyob zoo" raws li cov lus txib - tshem CMD ntawm txhua cov ntawv nyeem.color - Hloov xim (hom "pab xim" rau cov npe ntawm xim).goto - Mus rau ib lo lus tshwj xeeb hauv koj cov ntawv (koj yuav kawm paub ntau ntxiv tom qab) ncua - Pauses qhov hais kom sai thiab qhia cov lus: "Nias ib qho yuam sij txuas ntxiv mus …" thiab muaj ob peb ntxiv peb yuav kawm txog tom qab.

Kauj Ruam 3: Tab sis Yuav Ua Li Cas Yog Kuv Xav Ua Haujlwm Ntau Cov Lus txib

Tab sis Yuav Ua Li Cas Yog Kuv Xav Ua Haujlwm Ntau Cov Lus txib
Tab sis Yuav Ua Li Cas Yog Kuv Xav Ua Haujlwm Ntau Cov Lus txib

Qhov ntawd yog qhov twg BATCH los rau hauv. Sim luam qhov no rau hauv koj phau ntawv sau (Tsis yog Microsoft Word) thiab khaws ua BatchFile.batNotepad nyob hauv accessoriesNB: Koj yuav tsum khaws nws li. BAT lossis nws yuav tsis ua haujlwm. PS (luam BETWEEN cov hnub qub, tsis txhob tsis suav nrog lawv) ********************************************* ************** ncha Yog koj ntaus echo ua ntej kab lus nws qhia nws ua lus!.echo Wow, zoo nkauj heev! ************* ***************************************************** luam qhov ntawd rau hauv notepad thiab txuag raws li.batDouble-nyem rau ntawm.bat cov ntaub ntawv … txias hav! TSIS MUAJ. Nws mus nrawm heev… sim ntxiv ncua ntawm qhov kawg, zoo li no: ********************************** ************************* echo Yog koj ntaus ncha ua ntej kab lus nws qhia nws ua lus!.echo Wow, zoo nkauj heev! PAUSE* ********************************************************** ****** *********** Nws tau ua haujlwm, tab sis nws nyuaj rau nyeem nrog txhua cov ntaub ntawv hauv txoj hauv kev … yog vim li cas peb ntxiv "@echo tawm" rau saum; zoo li no: *** ********************************************************** ****** **********@echo offecho Yog tias koj ntaus echo ua ntej kab lus nws qhia nws ua lus!.echo Wow, zoo nkauj heev! PAUSE ************** ********************************************* Muaj! uas ua haujlwm zoo kawg nkaus, tam sim no koj tau sau koj thawj cov ntaub ntawv!

Kauj ruam 4: GOTO Command

GOTO Command
GOTO Command

Tam sim no peb yuav kawm paub siv GOTO cov lus txib li cas. GOTO hais kom dhia mus rau qee yam ntawm koj cov ntawv. yuav tsum muaj tus nyuv (:), ua ntej lo lus uas yuav dhau mus ua GOTO'edExample: koj paub laum, luam rau hauv notepad thiab khaws ua ntaub ntawv.bat. (tsis txhob theej lub hnub qub) ****** ********************************************@echo off: fishecho Qhov no tsuas yog ib qho lus tau rov hais dua thiab ntau dua; Nias Ctrl+C kom nres ntses ntses ******************************************* ******** Nco tseg: Ctrl+C yog txoj hauv kev thoob plaws hauv kev siv cov ntawv cais Dab tsi tshwm sim yog tias txhua lub sijhawm nws ntaus "Nias Ctrl … thiab lwm yam" GOTO hais kom ua mus rau qhov zoo tshaj plaws.

Kauj Ruam 5: START Command

Qhov pib hais kom pib ib yam dab tsi. Ntawm ntau los piav txog ntawm no. Piv txwv: qhib koj li CMD thiab ntaus: "pib www.instructables.com" Qhov no qhib koj qhov kev tshawb fawb yav dhau los thiab mus rau Instructables site. OR "pib itunes" OR Koj tseem tuaj yeem qhib cov ntaub ntawv lossis ntawv tais ceev tseg: "pib desktop / foldname ** NCO TSEG: Txhawm rau nkag mus rau cov ntaub ntawv / nplaub tshev uas muaj qhov chaw nyob hauv lub npe, muab cov cim hais (" ") ncig nws.eg pib" C: / desktop / folder name"

Kauj ruam 6: Ua tau

Ua tau zoo! Thov txuas mus rau Tsis Yog Li Qub Hauv Batch Tutorial rau qee qhov txias Batch lus txib! Yog tias koj xav sim qee yam offline, Kuv pom zoo kom kawm Learn Batch File Programming! los ntawm John Albert, yooj yim heev, ua raws tau yooj yim thiab zoo yog tias koj xav tau kom zoo dua!

Pom zoo: