Board logo

主題: [其他] [求助][其它]關於BAT的疑問 [打印本頁]

發表人: ROACH    時間: 2006-4-23 08:40 PM     主題: [求助][其它]關於BAT的疑問

想問一下
我想寫一個BAT批次檔~~

去拷貝一些我寫的程式到使用者的
C:\Windows\fonts

可是我發現OS的路徑
在WINXP是 C:\windows
但Win2000卻是  C:\winnt


批次檔要如何設計才能判別OS的正確路徑呢
發表人: alger    時間: 2006-4-23 10:43 PM

試試這個

copy c:\programe\.     %SystemRoot%\fonts
        ^^^^^^^^^^
        這裡是你程式放置位置
發表人: Vic    時間: 2006-4-24 11:23 AM

Variable  Sample Typical Value  
%SystemDrive%  
C:  
%SystemRoot%  
C:\WINNT
C:\WINDOWS
%SystemDirectory%  
C:\WINNT\System32
C:\WINDOWS\System32
%WinDir%  
C:\WINNT
C:\WINDOWS
____  C:\WINNT\Program Files  
%ComSpec%  
C:\WINNT\system32\cmd.exe  
%Temp%  
C:\DOCUME~1\Usr\LOCALS~1\Temp from
C:\Documents and Settings\Usr\Local Settings\Temp
%Tmp%  
%HOMEDRIVE%  
C: The drive letter associated with the user's home directory  
%HOMEPATH%  
The path to the user's home directory (excluding drive):
\Documents and Settings\Guest  
%OS%  
Windows_NT
The operating system the user is running  
%USERDOMAIN%  
The name of the domain that contains the user's account  
%USERNAME%  
The user's name  


全文位置: http://www.wilsonmar.com/1envvars.htm




歡迎光臨 TWed2k (http://twed2k.org/) Powered by Discuz! 4.1.0