Ph?n trm d?u hi?u t?c t? vn b?n t?p tin Batch

D?ch tiu ? D?ch tiu ?
ID c?a bi: 75634 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

TM T?T

B?ng cch s? d?ng m?t d?u hi?u ph?n trm (%) trong m?t t?p tin th?c thi ?i h?i r?ng 2% d?u hi?u (%) ?c xc ?nh.

V d?, cc l?nh ? hi?n th? "5 %" t? m?t t?p tin th?c thi s?:
   ECHO 5%%
				

THNG TIN THM

MS-DOS s? d?ng % 1, % 2,... %9 nh l tham s? d?ng l?nh thay th?. Cho V d?, tr?c khi th?c hi?n l?nh ECHO % 1, %1 s? ?c thay th? v?i tham s? ?u tin ?c thng qua ? t?p tin th?c thi. %0 thay th? b?ng l?nh ?c s? d?ng ? th?c thi t?p tin th?c thi.

M?t d?u hi?u n ph?n trm trn m?t d?ng ?c coi nh m?t nhn v?t "nul" trong m?t t?p tin th?c thi. Vi du:
   ECHO %     is processed as ECHO
   ECHO a%b   is processed as ECHO ab
				
N?u m?t l?nh c d?u hi?u 2%, MS-DOS s? x? l? b?t k? k? t? gi?a chng nh l m?t bi?n mi tr?ng ? ?c m? r?ng. V d?, n?u cc ?T l?nh cho th?y r?ng cc bi?n mi tr?ng hi?n t?i ang
   COMSPEC=C:\COMMAND.COM
   PATH=C:\DOS
   PROMPT=$P$G
   B=C
				
sau
   ECHO %PATH%     is processed as ECHO C:\DOS
   ECHO a%b%       is processed as ECHO aC
   ECHO a%b b%a    is processed as ECHO aa
				
N?u khng c khng c nhn v?t gi?a cc d?u hi?u 2%, m?t ph?n trm d?u hi?u t?c v khc s? v?n. y l l? do t?i sao m?t l?nh FOR echos tn c?a m?i t?p tin v?i m?t.COM m? r?ng s?
   FOR %V IN (*.COM) DO ECHO %V
				
nhng n?u l?nh tng t? ?c ?t trong m?t t?p tin th?c thi, sau y l b?t bu?c:
   FOR %%V IN (*.COM) DO ECHO %%V
				
Reference(s):

"Microsoft MS-DOS Batch File Quick Reference," Microsoft Press.

Thu?c tnh

ID c?a bi: 75634 - L?n xem xt sau cng: 17 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft MS-DOS 4.0 Standard Edition
  • Microsoft MS-DOS 5.0 Standard Edition
  • Microsoft MS-DOS 6.0 Standard Edition
  • Microsoft MS-DOS 6.2 Standard Edition
  • Microsoft MS-DOS 6.21 Standard Edition
  • Microsoft MS-DOS 6.22 Standard Edition
T? kha:
kbmt KB75634 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:75634
Khc t Ni dung trong C s Kin thc Khng con c h tr
Bi vi?t ny ni v? cc s?n ph?m m Microsoft khng c?n h? tr? n?a. Do , bi vi?t ny ?c cung c?p "nguyn b?n" v s? khng ?c c?p nh?t.

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com