Yuav Ua Li Cas Nyeem Command Syntax hauv Windows

Cov txheej txheem:

Yuav Ua Li Cas Nyeem Command Syntax hauv Windows
Yuav Ua Li Cas Nyeem Command Syntax hauv Windows
Anonim

Cov syntax ntawm ib qho kev hais kom ua yog cov cai rau kev khiav cov lus txib. Koj yuav tsum paub yuav ua li cas nyeem cov ntawv sau syntax thaum kawm siv cov lus txib kom koj thiaj li ua tau zoo.

Raws li koj tau pom ntawm no ntawm Lifewire thiab tej zaum lwm lub vev xaib, Command Prompt commands, DOS cov lus txib, thiab txawm tias ntau cov lus txib tau piav qhia nrog txhua hom slashes, brackets, italics, thiab lwm yam. Thaum koj paub txhua yam. ntawm cov cim no xa mus rau, koj tuaj yeem saib ntawm ib qho kev hais kom ua syntax thiab paub tam sim ntawd cov kev xaiv twg yuav tsum tau thiab cov kev xaiv twg tuaj yeem siv nrog lwm cov kev xaiv.

Nyob ntawm qhov chaw, koj yuav pom cov syntax sib txawv me ntsis thaum siv los piav qhia cov lus txib. Peb siv ib txoj kev uas Microsoft tau siv keeb kwm, thiab tag nrho cov lus txib uas peb tau pom nyob rau hauv ib qho chaw zoo sib xws, tab sis nco ntsoov tias koj yuav tsum ua raws li tus yuam sij syntax uas cuam tshuam rau cov lus txib koj nyeem thiab tsis xav tias tag nrho. cov vev xaib thiab cov ntaub ntawv siv tib txoj kev.

Command Syntax Key

Tus yuam sij syntax hauv qab no piav qhia txog yuav siv txhua qhov kev sau npe hauv cov lus txib li cas. Xav tias dawb los siv qhov no thaum peb taug kev los ntawm peb qhov piv txwv hauv qab ntawm lub rooj.

Command Syntax Reference Table
Cov khoom loj yuav tsum tau ntaus raws nraim li lawv tau pom, qhov no suav nrog cov lus bold, slashes, colons, thiab lwm yam.
Italic Italic cov khoom yog cov khoom uas koj yuav tsum tau muab. Tsis txhob nqa ib yam khoom italic lus thiab siv nws hauv cov lus txib raws li qhia.
S p a c e s Txhua qhov chaw yuav tsum tau muab tso rau. Yog hais tias ib qho kev hais kom ua syntax muaj qhov chaw, siv qhov chaw ntawd thaum ua tiav cov lus txib.
[Text in brackets] Txhua yam khoom hauv lub bracket yog xaiv tau. Cov brackets yuav tsum tsis txhob muab coj los siv yog li tsis txhob siv lawv thaum ua tiav cov lus txib.
Tshuaj sab nraud Txhua cov ntawv tsis muaj nyob hauv ib lub cim yuav tsum tau. Hauv syntax ntawm ntau cov lus txib, tib cov ntawv tsis nyob ib puag ncig los ntawm ib lossis ntau lub brackets yog lub npe hais kom ua nws tus kheej.
{Text inside braces} Cov khoom hauv ib lub brace yog cov kev xaiv, uas koj yuav tsum xaiv nkaus xwb ib. Cov braces tsis yog yuav tsum tau coj los ua kom tsis txhob siv lawv thaum ua tiav cov lus txib.
Vim | bar Vertical tuav yog siv los cais cov khoom nyob rau hauv cov hlua khi thiab cov hlua khi. Tsis txhob siv cov kab ntsug ntsug-tsis txhob siv lawv thaum ua cov lus txib.
Ellipsis … Ib qho ellipsis txhais tau hais tias ib yam khoom tuaj yeem rov qab mus tsis tau. Tsis txhob ntaus ellipsis lus thaum ua tiav cov lus txib thiab saib xyuas siv qhov chaw thiab lwm yam khoom xav tau raws li qhia thaum rov ua cov khoom.

Brackets kuj qee zaum hu ua square brackets, braces qee zaum hu ua squiggly brackets lossis paj brackets, thiab ntsug tuav qee zaum hu ua kav, kab ntsug, lossis ntsug slashes. Txawm hais tias koj hu lawv li cas los xij, tsis muaj leej twg yuav tsum raug coj mus rau qhov tseeb thaum ua tiav cov lus txib.

Example 1: Vol Command

Ntawm no yog cov syntax rau vol hais kom ua, cov lus txib muaj los ntawm Command Prompt nyob rau hauv tag nrho cov versions ntawm lub qhov rais operating system:

vol [tsav:

Image
Image

Lo lus vol yog nyob rau hauv bold, txhais tau tias nws yuav tsum tau nyeem. Nws kuj tseem nyob sab nraud ib qho brackets, txhais tau tias nws yuav tsum tau. Peb mam li saib ob peb kab lus hauv qab.

Follow vol yog chaw. Qhov chaw nyob rau hauv ib qho kev hais kom ua syntax yuav tsum tau muab coj los ua, yog li thaum koj ua tiav cov lus txib vol, koj yuav tsum tau muab qhov chaw nruab nrab ntawm vol thiab txhua yam uas yuav tuaj tom ntej.

Brackets qhia tias txhua yam uas muaj nyob rau hauv lawv yog xaiv tau-txhua yam nyob rau hauv tsis tas yuav tsum tau rau cov lus txib ua haujlwm tab sis tej zaum yuav yog qee yam koj xav siv, nyob ntawm seb koj siv cov lus txib rau. Cov brackets yeej tsis raug muab coj los hais kom tsis txhob suav nrog lawv thaum ua tiav cov lus txib.

Inside the brackets is the italicized word drive, ua raws li tus kab mob siab tawv. Txhua yam italicized yog ib yam uas koj yuav tsum tau muab, tsis txhob siv lus. Hauv qhov no, tus tsav yog xa mus rau daim ntawv tsav tsheb, yog li koj yuav xav muab daim ntawv tsav tsheb ntawm no. Ib yam li nrog vol, txij li : yog ua siab tawv, nws yuav tsum tau ntaus raws li qhia.

Raws li tag nrho cov ntaub ntawv ntawd, ntawm no yog qee txoj hauv kev siv tau thiab siv tsis tau los ua cov lus txib vol thiab vim li cas:

vol

Valid: Cov lus txib vol tuaj yeem ua tiav los ntawm nws tus kheej vim tsav : yog xaiv tau vim nws nyob ib puag ncig los ntawm kab.

vol d

Invalid: Lub sijhawm no, xaiv ib feem ntawm cov lus txib raug siv, qhia tias tsav yog d, tab sis txoj hnyuv tsis nco qab. Nco ntsoov, peb paub cov nyuv nrog lub tsav vim nws muaj nyob rau hauv tib pawg ntawm cov brackets thiab peb paub tias nws yuav tsum tau siv lus vim nws bold.

vol e: /p

Invalid: Tus /p kev xaiv tsis tau teev nyob rau hauv cov lus txib syntax, yog li cov lus txib vol tsis khiav thaum siv nws.

vol c:

Valid: Hauv qhov no, qhov kev xaiv tsav : kev sib cav tau siv raws li qhov xav tau.

Example 2: Shutdown Command

Cov lus teev tseg ntawm no yog rau cov lus txib kaw thiab pom tseeb ntau qhov nyuaj dua li hauv vol hais kom ua piv txwv saum toj no. Txawm li cas los xij, tsim los ntawm qhov koj twb paub lawm, muaj tsawg heev los kawm ntawm no:

shutdown [ /i | /l | /s | /r | /g | /a | /p | /h | /e] [ /f] [ /m \\ computername] [ /t xxx] [ /d [ p: | u:] xx: yy] [/c " comment"

Image
Image

Nco ntsoov tias cov khoom nyob rau hauv cov khoom lag luam yog ib txwm xaiv, cov khoom sab nraud ntawm cov khoom lag luam yog ib txwm xav tau, cov khoom loj thiab qhov chaw yog ib txwm muaj, thiab cov khoom italicized yuav tsum muab los ntawm koj.

Lub tswv yim tshiab loj hauv qhov piv txwv no yog kab ntsug. Vertical tuav nyob rau hauv brackets qhia txog kev xaiv xaiv. Yog li hauv qhov piv txwv saum toj no, koj tuaj yeem ua tau, tab sis tsis tas yuav, xaiv suav nrog ib qho ntawm cov kev xaiv hauv qab no thaum ua tiav cov lus txib kaw: /i, /la, /p, /h, los yog /e Zoo li brackets, ntsug kab muaj nyob los piav qhia cov syntax thiab yuav tsum tsis txhob muab sau cia.

Cov lus txib kaw kuj muaj qhov kev xaiv nested hauv [ /d [ p: | u:] xx : yy]-yeej, ib qho kev xaiv hauv ib qho kev xaiv.

Zoo li nrog cov lus txib vol hauv thawj qhov piv txwv, ntawm no yog qee txoj hauv kev siv tau thiab siv tsis tau siv cov lus txib kaw:

kaw /r /s

Invalid: Tus /r thiab /s kev xaiv tsis tuaj yeem siv ua ke. Cov kab ntsug no qhia txog kev xaiv, uas koj tuaj yeem xaiv ib qho xwb.

shutdown /s p:0:0

Invalid: Siv /s zoo kawg nkaus tab sis siv p:0:0tsis yog vim qhov kev xaiv no tsuas yog muaj nrog /d kev xaiv, uas peb tsis nco qab siv. Kev siv kom raug yuav yog shutdown /s /d p:0:0.

shutdown /r /f /t 0

Valid: Txhua qhov kev xaiv tau siv raug rau lub sijhawm no. Qhov kev xaiv / r tsis siv nrog lwm yam kev xaiv hauv nws cov txheej txheem, thiab / fthiab / tkev xaiv tau siv raws li tau piav qhia hauv kab lus.

Example 3: Net Use Command

Rau peb qhov piv txwv kawg, cia peb saib cov lus txib siv net, ib qho ntawm cov lus txib. Nws cov syntax me ntsis ntxhov, yog li peb tau sau nws hauv qab no kom piav qhia yooj yim me ntsis (saib tag nrho cov syntax ntawm no):

net use [{ devicename | }] [ computername sharename [{ password | }] [ /persistent: { yes | no }] [ /savecred] [ /delete

Image
Image

Cov lus txib siv net muaj ob qhov piv txwv ntawm cov ntawv sau tshiab: lub brace. Ib txoj hlua khi qhia tias ib qho, thiab tsuas yog ib qho, ntawm cov kev xaiv, sib cais los ntawm ib lossis ntau txoj kab ntsug, yuav tsum tau. Qhov no tsis zoo li lub bracket nrog cov kab ntsug uas qhia txog kev xaiv xaiv.

Cia peb saib qee qhov siv tau thiab siv tsis raug ntawm kev siv net:

net siv e:\\server\files

Invalid: Thawj txheej braces txhais tau tias koj tuaj yeem qhia lub npe ntaus ntawv lossis siv tus cim cim - koj ua tsis tau ua ob leeg. Txawm li cas los xij net siv e: \\server\files lossis net siv\\ server\files yuav yog txoj hauv kev siv tau los ua kev siv net hauv qhov no cas.

net use\\appsvr01\source 1lovet0visitcanada /persistent:no

Valid: Peb raug siv ntau txoj kev xaiv hauv qhov kev ua tiav ntawm kev siv net, suav nrog ib qho kev xaiv nested. Peb siv lub thaum xav tau los xaiv ntawm nws thiab qhia lub npe ntaus ntawv, peb tau teev ib qho kev qhia [qhov chaw] ntawm tus neeg rau zaub mov [appsvr01], thiab tom qab ntawd xaiv los qhia tus {password } rau qhov ntawd share, 1lovet0visitcanada, es tsis txhob yuam net siv kom peb ib leeg {}. Peb kuj tau txiav txim siab tsis tso cai rau qhov kev sib koom tshiab no kom rov txuas tau txuas ntxiv rau lwm zaus peb pib lub computer [ /persistent:no].

net use /persistent

Invalid: Hauv qhov piv txwv no, peb xaiv los siv qhov kev xaiv /persistent hloov tab sis tsis nco qab suav nrog cov nyuv nyob ib sab ntawm nws thiab kuj tsis nco qab xaiv ntawm ob txoj kev xaiv, yog lossis no, nruab nrab ntawm txoj hlua khi. Executing net use /persistent:yes yuav yog qhov siv tau ntawm kev siv net.

Pom zoo: