Dab tsi yog dp0 hauv cov ntaub ntawv batch?
Dab tsi yog dp0 hauv cov ntaub ntawv batch?

Video: Dab tsi yog dp0 hauv cov ntaub ntawv batch?

Video: Dab tsi yog dp0 hauv cov ntaub ntawv batch?
Video: Yog hmoov dab tsi - Gao Nou Kue ft. Mang Vang (Official Music Video) New song 2020 2024, Kaum ib hlis
Anonim

Cov % ~ dp0 ua (uas yog xoom) sib txawv thaum hais hauv Windows batch ntaub ntawv yuav nthuav mus rau tsab ntawv thiab txoj kev ntawm qhov ntawd batch ntaub ntawv . Cov variables% 0-% 9 xa mus rau cov kab hais kom ua ntawm cov batchfile . % 1-% 9 xa mus rau cov kab lus hais kom ua tom qab cov batchfile npe. %0 hais txog qhov batch ntaub ntawv nws tus kheej.

Raws li txoj cai, CD hauv cov ntaub ntawv batch yog dab tsi?

Cov cd hais kom ua, tseem hu ua chdir (changedirectory), yog ib qho kev hais kom ua-kab plhaub lus txib siv los hloov cov npe ua haujlwm tam sim no hauv ntau lub tshuab ua haujlwm. Nws tuaj yeem siv rau hauv cov ntawv plhaub thiab batch cov ntaub ntawv.

Tom qab ntawd, lo lus nug yog, Pushd command yog dab tsi? Cov pushd txib yog siv los khaws cov directory tam sim no rau hauv ib pawg thiab txav mus rau ib phau ntawv tshiab. Tsis tas li ntawd, popd tuaj yeem siv rov qab mus rau yav dhau los phau ntawv teev npe uas yog sab saum toj ntawm pawg. Yog tsis muaj daim ntawv teev npe, thawb hloov cov directory rau txhua yam nyob rau sab saum toj ntawm thestack.

Dhau li ntawm no, kuv yuav tawm tswv yim li cas hauv cov ntaub ntawv batch?

  1. REM yuav tsum tau ua raws li qhov chaw lossis lub cim tab, tom qab ntawv tawm tswv yim.
  2. Yog ECHO ON, cov lus pom tshwm.
  3. Koj tuaj yeem tso cov lus tso rau hauv cov ntaub ntawv batch los ntawm kev pib cov lus hais nrog ob kab lus [::].
  4. Koj tuaj yeem siv REM los tsim cov ntaub ntawv xoom-byte yog tias koj siv cov cim taw qhia tam sim tom qab REM hais kom ua.

batch file piv txwv yog dab tsi?

Thaum a batch ntaub ntawv khiav, lub plhaub program (feem ntau yog COMMAND. COM lossis cmd.exe) nyeem cov ntaub ntawv thiab executesits commands, ib txwm line-by-line. Unix-zoo li kev khiav hauj lwm systems, xws li Linux, muaj qhov zoo sib xws, tab sis hloov tau ntau dua, hom ntaub ntawv hu ua lub plhaub tsab ntawv . Lub filename extension. ib bat yog siv hauv DOS thiab Windows.

Pom zoo: