Cov txheej txheem:

Basic Windows Batch Tutorial: 5 Kauj Ruam
Basic Windows Batch Tutorial: 5 Kauj Ruam

Video: Basic Windows Batch Tutorial: 5 Kauj Ruam

Video: Basic Windows Batch Tutorial: 5 Kauj Ruam
Video: Топ 5 скрытых полезных программ Windows 10 2024, Kaum ib hlis
Anonim
Basic Windows Batch Tutorial
Basic Windows Batch Tutorial

nyob zoo cov phooj ywg, hauv qhov teeb meem ntawm 24h Kuv tau tshaj tawm qhov qhia tawm qhov rai kuv tau cog lus rau koj hauv kuv qhov kev qhia zaum kawg. yog tias koj tsis tau pom nws nyem rau ntawm qhov txuas ntawm no:

qhov no yog qhov ntau heev (x100) cov hauv paus ntawm cov phiaj xwm ua haujlwm. qhov no yog rau tag nrho cov pib. tsis txhob yig mus saib qhov no yog tias koj yog tus kws tshaj lij. Txawm li cas los xij, nws yuav yog qhov zoo rau koj kom tau txais kuv cov lus pom: p

yog li, txhawm rau nrhiav pawg, nrhiav cov ntawv qhia zaub mov thiab ntaus hauv notepad. qhov no yog qhov uas koj yuav tau sau koj tsab ntawv. kev siv thev naus laus zis, peb tuaj yeem hu qhov no yog lub qhov rai tshiab, vim tias, zoo li hauv lwm cov lus programming, ib txwm muaj lub qhov rai tshiab rau tib neeg sau thiab lawv ua cov lus txib hauv lub plhaub uas kuv yuav qhia koj.

txhawm rau nkag mus rau 'plhaub' hom hauv kab tshawb 'cmd' uas luv rau kev hais kom ua sai. qhov no feem ntau yog siv los ntawm cov neeg siv nug lub khoos phis tawj ua qee yam xws li txwv tus neeg siv lossis rub tawm daim ntawv thov. tab sis hnub no, peb yuav siv nws los ua lub hom phiaj.

Kauj Ruam 1: Sim Cov No…

Sim Cov No…
Sim Cov No…

Nov yog qee cov lus txib yooj yim uas peb yuav siv:

ncha * ib yam dab tsi * - ua dab tsi nws zoo li echos nws. sim qhov no hauv cmd hom echo Nyob Zoo Ntiaj Teb. iconic programmer's pib sau ntawv. kuv tsis yog tus pib, tab sis kuv tseem hais nws

cls - tshem tawm nplooj ntawv. sim nws. hauv cmd, ntaus lub nra ntawm cov khoom siv tsis raug, tom qab ntawd nkag mus rov ua dua txog lwm 3 lab lub sijhawm, tom qab ntawd ntaus hauv cls ces txhua yam yuav ploj mus

C: / cov neeg siv> ergehoeiboegboieghoimythgiuheuhon4jht4phnn

C: / cov neeg siv> rwiheiuybgviugebvrgvbhgbrovuogvihbghbohrbhw

C: / cov neeg siv> ljehfbocubeuohboubgyunrechongrcenogrcho

C: / cov neeg siv> cls

C: / cov neeg siv> _

@echo tawm - qhov no yuav tua C: / cov neeg siv> headcases uas kuv pom kev thab plaub heev. Kuv vam tias kuv tuaj yeem tshem ntawm '>>>' hauv nab hab sej ib yam.

goto - muaj txiaj ntsig zoo hauv cov loops. qhov no yuav coj tus neeg siv mus rau qhov sib txawv ntawm lub ntiaj teb (thov txim kuv tau nqa mus), Kuv txhais tau tias, tsab ntawv.

pib - nws pib qee yam. pib cmd yuav pib cmd. BTW pib thiab mus yog qhov ua ke txaus ntshai heev. Kuv tsis nyob ntawm no qhia koj yuav ua li cas ua computercide, tab sis tsis txhob tso qhov pib hais kom ua hauv lub voj.

ncua - qhov no yuav ncua nws thiab nws yuav los nrog Nias ib qho tseem ceeb txuas ntxiv mus…

me ntsis ntev…

Kauj Ruam 2: Ur Thawj Txoj Haujlwm

Ua Thawj Qhov Kev Pabcuam
Ua Thawj Qhov Kev Pabcuam

txoj haujlwm no yuav suav rau 1000. thov sim ntaus nws ntau dua li theej thiab muab tshuaj txhuam kom koj nkag siab zoo dua:

@echo tawm

set /ib x = 1

: saum

set /a x =%x%+1

ncha %x %

yog %x %== 1000 goto tawm

mus top

: tawm

cls ua

ncua

tawm

teeb /p cov tswv yim = - tsis nyob hauv tsab ntawv no, tab sis muab cov tswv yim sib txawv los ntawm tus neeg siv.

set /a x = 1 - teeb tsa cov lej sib txawv kom x = 1

% x% - hais txog qhov sib txawv uas peb tau teeb tsa ua ntej. thaum peb sau qhov ntawd, lub khoos phis tawj yuav paub tias peb txhais tau tias '1'

== - nws txhais tau tias TSIS YOG sib npaug. lees paub qhov sib npaug.

yog li, muaj peb, ur thawj txoj haujlwm!

thov xa qhov no rau kuv ntawm koj puas tau ua txoj haujlwm no.

Kauj Ruam 3: Tawm Tswv Yim & Tso Tawm

Tawm tswv yim & Tso Tawm
Tawm tswv yim & Tso Tawm

yooj yim heev Kuv tau qhia koj cov lus txib hauv ntu 2. sau qhov program no thiab kawm los ntawm kev tso tawm.

@echo tawm

kob 2f

: saum

cls ua

echo nyob zoo hnub

echo koj lub npe hu li cas?

set /p cov tswv yim =

cls ua

ncha nyob zoo %input %, koj ua li cas?

echo koj puas xav txuas ntxiv? (y/n)

set /p ans =

yog %ans %== y pib www.instructables.com

yog %ans %== n tau txais kev lees paub

yog % ans % neq y tau txais thov txim

yog % ans % neq n goto thov txim

: paub meej tias

cls ua

ncha koj puas paub tseeb tias koj xav tawm mus? (y/n)

set /p ans =

yog %ans %== y tawm

yog %ans %== n mus rau saum

: thov txim

cls ua

ncha kuv thov txim, tab sis kuv tsis nkag siab koj txhais li cas.

echo txuas ntxiv? (y/n)

set /p ans =

yog %ans %== y mus rau saum

yog %ans %== n tau txais kev lees paub

neq - tsis sib npaug

yog tias koj tseem nyob ntawm no, welldone rau kev khaws cia.

Kauj Ruam 4: Sijhawm thiab Hnub Tim

Sijhawm thiab Hnub Tim
Sijhawm thiab Hnub Tim

cov kev hloov pauv no twb tau teeb tsa los ntawm cmd.

C: / Cov neeg siv> ncha %sijhawm %

9:16:25

C: / Cov neeg siv> ncha %hnub tim %

2018/8/22 Hnub Wednesday

qhov no yog koj txoj haujlwm yog tias koj zoo li tus kws tshaj lij tam sim no, sim tsim lub moos nrog cov zis zoo li daim duab.

qhov no yog nws! yog tias koj yog tus pib, koj tam sim no tsis yog! Nrog koj zoo siab!

Nco ntsoov tso cov duab ntawm cov haujlwm hauv koj puas tau ua qhov haujlwm no.

Kauj ruam 5: Ua tiav

Ua tiav
Ua tiav

Kuv yuav twv yuav raug tshaj tawm cov ntsiab lus ntxiv tom qab.

yog tias koj xav kawm ntau pawg, Kuv pom zoo kom pib ua cov txheej txheem los ntawm seJma

Nov yog qee qhov program kuv tau ua, Kuv yuav tsum tau qhia meej tias koj sim ua lawv

kev ua lej yuav tsis poob, tsis muaj teeb meem dab tsi koj ntaus hauv nws.

ntses ib qho yog lub tshuab ua kom lub computer txaus ntshai uas kuv xav kom koj tsis txhob khiav. koj tuaj yeem tso nws rau hauv usb yog li koj tuaj yeem nres qhov program

tus xaiv lub xaib yog qhov yooj yim heev los ua, tsuas yog tau txais koj daim ntawv lo thiab lub vev xaib url txoj cai!

ok, yog li ntawd nws yog!

Pom zoo: