BAT - batch cov ntaub ntawv muaj cov lus txib teev cia rau automating tej yam kev ua nyob rau hauv lub qhov rais. Nws tuaj yeem khiav ib los yog ob peb zaug nyob ntawm nws cov ntsiab lus. Tus neeg siv txhais cov ntsiab lus ntawm batch cov ntaub ntawv ntawm nws tus kheej - nyob rau hauv txhua rooj plaub, cov no yuav tsum yog lus sam hwm uas DOS txhawb. Hauv tsab xov xwm no peb yuav xav txog kev tsim cov ntaub ntawv zoo li no.
Tsim cov ntaub ntawv BAT hauv Windows 10
Nyob rau hauv txhua qhov version of Windows OS, koj tuaj yeem tsim cov ntaub ntawv rau batch thiab siv lawv mus ua haujlwm nrog cov ntawv sau, cov ntaub ntawv lossis lwm cov ntaub ntawv. Cov kev pabcuam thib peb tsis tsim nyog rau qhov no, vim tias qhov chaw nws ua haujlwm muaj qhov tsim nyog rau qhov no.
Ceev faj thaum sim los tsim ib daim BAT nrog cov tsis paub thiab cov ntsiab lus tsis tiav. Cov ntaub ntawv zoo li no tuaj yeem ua rau koj lub PC raug mob los ntawm kev siv tus kab mob vwm, tus neeg thab nyub lossis tus nqu. Yog tias koj tsis to taub dab tsi cov lus txib ntawm cov cai, ua ntej paub lawv cov ntsiab lus.
Method 1: Notepad
Los ntawm daim ntawv thov classic Notepad koj tuaj yeem ua tau tsim thiab sau BAT nrog rau qhov tsim nyog ntawm cov lus txib.
Qhov Xaiv 1: Pib Sau Npe
Qhov kev xaiv no yog qhov ntau, yog li xav txog nws ua ntej.
- Los ntawm "Pib" khiav lub qhov rais uas muaj qhov rais Notepad.
- Sau cov kab uas tsim nyog, thaum lawv kuaj xyuas qhov tseeb.
- Nias rau "Cov Ntaub Ntawv" > Txuag Li.
- Ua ntej xaiv cov directory qhov twg cov ntaub ntawv yuav raug khaws tseg cia hauv lub tshav pob "Filename" es tsis txhob ua rau lub hnub qub, nkag rau lub npe tsim nyog, thiab hloov qhov ncua ntxiv tom qab cov teev kom pauv .txt on .bat. Hauv teb "Cov Ntaub Ntawv Siv" xaiv xaiv "Txhua Ntaub Ntawv" thiab nias "Txuag".
- Yog hais tias muaj cov ntawv sau ua lus Lavxias hauv cov ntawv nyeem, txoj kev tawm tswv yim thaum tsim cov ntaub ntawv yuav tsum yog "ANSI". Txwv tsis pub, es tsis txhob cia lawv, nyob rau ntawm Txoj Kev Hais Plaub koj yuav tau txais cov ntawv nyeem tsis tau.
- Cov ntaub ntawv batch yuav khiav raws li cov ntaub ntawv tsis tu ncua. Yog tias tsis muaj cov lus txib hauv cov ntsiab lus uas muaj kev sib raug zoo nrog tus neeg siv, qhov kev hais kom ua kab yog tshwm rau ib pliag. Txwv tsis pub, nws lub qhov rais qhib nrog cov lus nug los yog lwm cov kev ua uas yuav tsum tau teb los ntawm tus neeg siv.
Qhov Xaiv 2: Ntsiab Lus Qhia Ntawv
- Koj tuaj yeem tau qhib qhov chaw nyob tam sim no uas koj npaj kom txuag tau cov ntaub ntawv, txoj cai-nias rau ntawm qhov chaw npliag, taw tes rau "Tsim" thiab xaiv los ntawm daim ntawv teev npe "Cov Ntaub Ntawv Sau".
- Muab nws lub npe yam thiab hloov qhov ncua ntev tom qab teev .txt on .bat.
- Ib qho ceeb toom yuav tsum tshwm sim txog kev hloov cov ntaub ntawv ntxiv. Pom zoo nrog nws.
- Nias rau ntawm daim ntawv RMB thiab xaiv "Hloov".
- Cov ntaub ntawv yuav qhib rau hauv Notepad npliag, thiab koj tuaj yeem sau rau ntawm koj qhov kev pom zoo.
- Tiav lawm "Pib" > "Txuag" ua txhua yam hloov. Rau tib lub hom phiaj, koj tuaj yeem siv cov keyboard shortcut Ctrl + S.
Yog tias koj muaj Notepad ++ ntsia koj lub computer, nws yog qhov zoo uas siv nws. Daim ntawv thov no qhia txog cov syntax, ua kom yooj yim rau kev ua hauj lwm nrog kev tsim ntawm ib txheej lus txib. Nyob rau sab saum toj vaj huam sib luag muaj lub sijhawm los xaiv tus Cyrillic encoding ("Encodings" > "Cyrillic" > "OEM 866"), txij li tus txheej txheem ANSI rau qee cov tseem tseem tuaj yeem tso duab krakozyabry tsis yog ntawm cov ntawv sau nkag rau hauv Lavxias teb sab qhov tsim.
Txoj kev 2: Kev hais kom ua
Los ntawm lub console, tsis muaj teeb meem, koj tuaj yeem tsim ib qho BAT, los yog ua tiav BAT, uas yuav tom qab dhau los ntawm nws.
- Qhib cov kev hais kom ua rau txhua txoj kev yooj yim, piv txwv li, ntawm "Pib"los ntawm nkag mus rau nws lub npe hauv qhov kev tshawb nrhiav.
- Sau pawg
luam nrog c: lumpics_ru.bat
qhov twg daim ntawv con - pawg neeg uas yuav tsim cov ntawv nyeem c: - cov ntaub ntawv tseg cia lumpics_ru - cov ntaub ntawv npe, thiab .bat - nthuav tawm ntawm cov ntawv nyeem. - Koj yuav pom tau tias tus cursor blinking tau tsiv mus rau kab hauv qab - ntawm no koj tuaj yeem sau cov ntawv. Koj tuaj yeem txuag tau cov ntaub ntawv npliag, thiab kom paub tias yuav ua li cas li no, mus rau kauj ruam tom ntej. Txawm li cas los xij, feem ntau cov neeg siv nkag mus rau cov lus txib tsim nyog.
Yog tias koj sau cov ntawv ntawm tus ntawv, mus rau txhua kab tshiab nrog tus yuam sij. Ctrl + Sau. Yog tias koj muaj ib qho kev npaj ua ntej thiab luam qauv ntawm kev cai, tsuas yog right-click on qhov chaw tsis muaj dab tsi thiab seb dab tsi nyob rau ntawm phau ntawv teev cia yuav muab tso rau hauv.
- Txhawm rau txuag tau cov ntaub ntawv, siv lub ntsiab ua ke Ctrl + Z thiab nias Sau. Lawv lub nias yuav tshwm rau hauv lub nploog raws li pom hauv screenshot hauv qab no - qhov no yog qhov qub. Nyob rau hauv cov ntaub ntawv batch, no ob lub cim yuav tsis tshwm sim.
- Yog tias txhua yam zoo, koj yuav pom ib daim ntawv ceeb toom nyob rau ntawm Kev Hais Kab.
- Txheeb xyuas qhov tseeb ntawm cov ntaub ntawv tsim, khiav nws li lwm cov ntaub ntawv executable.
Tsis txhob hnov qab tias thaum twg koj tuaj yeem kho cov ntaub ntawv batch los txhaj rau lawv nrog tus mouse nas khawm thiab xaiv qhov khoom "Hloov", thiab los cawm, nias Ctrl + S.