  | 
				VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.   
				 | 
			 
		 
		 
	
		| 上一篇主題 :: 下一篇主題   | 
	 
	
	
		| 發表人 | 
		內容 | 
	 
	
		Watermelon
 
 
  註冊時間: 2005-01-22 文章: 204
 
  第 1 樓
  | 
		
			
				 發表於: 星期三 五月 10, 2017 6:59 pm    文章主題: COPY file c:\00\FREE3OF9.TTF to c:\windows\fonts無法建立檔案 | 
				     | 
			 
			
				
  | 
			 
			
				COPY file c:\00\FREE3OF9.TTF to c:\windows\fonts
 
RUN COPY c:\00\FREE3OF9.TTF c:\windows\fonts
 
這2個都不行請問各前輩要如何才能把字型檔複製進去? | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		ckp6250
 
 
  註冊時間: 2004-07-30 文章: 1645
 
  第 2 樓
  | 
		
			
				 發表於: 星期三 五月 10, 2017 9:04 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				COPY file c:\00\FREE3OF9.TTF to c:\windows\fonts\FREE3OF9.TTF
 
這樣行不? | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		syntech
 
 
  註冊時間: 2003-05-16 文章: 4252 來自: Taipei,Taiwan
  第 3 樓
  | 
		 | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		Watermelon
 
 
  註冊時間: 2005-01-22 文章: 204
 
  第 4 樓
  | 
		
			
				 發表於: 星期四 五月 11, 2017 12:22 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				COPY file c:\00\FREE3OF9.TTF to c:\windows\fonts\FREE3OF9.TTF 
 
還是無法建立檔案
 
 
COPY file c:\00\FREE3OF9.TTF to c:\111\FREE3OF9.TTF
 
 
用上面這個資料夾是OK的其他資料夾也OK,就c:\windows\fonts這資料夾搞不定! | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		215001
 
 
  註冊時間: 2003-06-11 文章: 393
 
  第 5 樓
  | 
		
			
				 發表於: 星期四 五月 11, 2017 8:50 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 以系統管理員身份執行你的程式看看 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		syntech
 
 
  註冊時間: 2003-05-16 文章: 4252 來自: Taipei,Taiwan
  第 6 樓
  | 
		 | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		Watermelon
 
 
  註冊時間: 2005-01-22 文章: 204
 
  第 7 樓
  | 
		
			
				 發表於: 星期四 五月 11, 2017 2:06 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 感謝各位前輩!我是有先搜尋也試了不行才再問看看!謝謝大家! | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		garfield Site Admin
  
  註冊時間: 2003-01-30 文章: 2160
 
  第 8 樓
  | 
		
			
				 發表於: 星期四 五月 11, 2017 11:03 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				雖然使用者是administrator , 
 
但在執行cmd.exe 時還是要選"以系統管理員的身份執行",
 
才能將檔案複製到windows資料夾
 
你可以在你的電腦搜尋到 FoxRun.pif ,將它複製到你的執行檔那個資料夾.
 
並按滑鼠右鍵, 在"內容"."相容性", "以系統管理員的身份執行此程式"打勾.
 
這樣你run 就沒問題了. _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		Watermelon
 
 
  註冊時間: 2005-01-22 文章: 204
 
  第 9 樓
  | 
		
			
				 發表於: 星期二 五月 16, 2017 11:40 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				搞不定!
 
暫時放棄了,非常感謝各前輩! | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		syntech
 
 
  註冊時間: 2003-05-16 文章: 4252 來自: Taipei,Taiwan
  第 10 樓
  | 
		
			
				 發表於: 星期二 五月 16, 2017 1:11 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				其實有個巧門.
 
 
先做一個批次檔可以call 其他批次檔.
 
再把這個批次檔編譯成exe檔,
 
最後建立這個exe檔的捷徑並給它系統管理者的權限.
 
 
日後透過這個捷徑執行的批次檔就會取得系統管理者權限,
 
做任何壞事.
 
 
           
 
 
 
----
 
在win8 之後,
 
使用者設定成"系統管理者",
 
但其實權限並非以往(win7)以前的"系統管理者"權限,
 
比poweruser 高,但比 administrator 低.
 
而win8以後限制使用administrator,
 
所以很多情況會出現權限不足. _________________ 如果公司有下列困擾:
 
1. 找不到便宜,快速,簡易的 生產排程軟體
 
2. 不知道如何快速排定 採購計劃
 
3. 成本抓不準,自己算比軟體算有用
 
4. 想學習系統規劃,想找系統架構的顧問
 
 
請聯絡我們,也許我們幫得上忙 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		ckp6250
 
 
  註冊時間: 2004-07-30 文章: 1645
 
  第 11 樓
  | 
		
			
				 發表於: 星期二 五月 16, 2017 4:45 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				看來,不出手不行了。
 
 
setFont("c:\00\FREE3OF9.TTF")
 
 
 
 	  | 代碼: | 	 		  
 
Function SetFont
 
Lparameters vFontName
 
Clear Dlls
 
 
Private iRetVal, iLastError
 
Private sFontDir, sSourceDir, sFontFileName, sFOTFile
 
Private sWinDir, iBufLen
 
iRetVal = 0
 
 
***** Code to customize with actual file names and locations.
 
*-- .TTF file path.
 
sSourceDir = Addbs(Justpath(vFontName))
 
 
*-- .TTF file name.
 
sFontFileName = Justfname(vFontName)
 
 
*-- Font description (as it will appear in Control Panel).
 
sFontName = Juststem(vFontName) + " (TrueType)"
 
******************** End of code to customize *****
 
 
Declare Integer CreateScalableFontResource In win32api ;
 
   LONG fdwHidden, ;
 
   STRING lpszFontRes, ;
 
   STRING lpszFontFile, ;
 
   STRING lpszCurrentPath
 
 
Declare Integer AddFontResource In win32api ;
 
   STRING lpszFilename
 
 
Declare Integer RemoveFontResource In win32api ;
 
   STRING lpszFilename
 
 
Declare Long GetLastError In win32api
 
 
Declare Integer GetWindowsDirectory In win32api String @lpszSysDir,;
 
   INTEGER iBufLen
 
 
#Define WM_FONTCHANGE   29 && 0x001D
 
#Define HWND_BROADCAST  65535 && 0xffff
 
 
Declare Long SendMessage In win32api ;
 
   LONG HWnd, Integer Msg, Long wParam, Integer Lparam
 
 
*!*   #Define HKEY_LOCAL_MACHINE 2147483650   && (HKEY) 0x80000002
 
#Define SECURITY_ACCESS_MASK 983103     && SAM value KEY_ALL_ACCESS
 
 
Declare RegCreateKeyEx In ADVAPI32.Dll ;
 
   INTEGER, String, Integer, String, Integer, Integer, ;
 
   INTEGER, Integer @, Integer @
 
 
Declare RegSetValueEx In ADVAPI32.Dll;
 
   INTEGER, String, Integer, Integer, String, Integer
 
 
Declare RegCloseKey In ADVAPI32.Dll Integer
 
 
*-- Fonts folder path.
 
*-- Use the GetWindowsDirectory API function to determine
 
*-- where the Fonts directory is located.
 
sWinDir = Space(50)  && Allocate the buffer to hold the directory name.
 
iBufLen = 50         && Pass the size of the buffer.
 
iRetVal = GetWindowsDirectory(@sWinDir, iBufLen)
 
 
*-- iRetVal holds the length of the returned string.
 
*-- Since the string is null-terminated, we need to
 
*-- snip the null off.
 
sWinDir = Substr(sWinDir, 1, iRetVal)
 
sFontDir = sWinDir + "\FONTS\"
 
 
*-- Get .FOT file name.
 
sFOTFile  = sFontDir + Left(sFontFileName, ;
 
   LEN(sFontFileName) - 4) + ".FOT"
 
 
*-- Copy to Fonts folder.
 
 
Copy File (sSourceDir + sFontFileName) To    (sFontDir + sFontFileName)
 
 
*-- Create the font.
 
iRetVal = ;
 
   CreateScalableFontResource(0, sFOTFile, sFontFileName, sFontDir)
 
If iRetVal = 0 Then
 
   iLastError = GetLastError ()
 
   If iLastError = 80
 
      Messagebox("Font file " + sFontDir + sFontFileName + ;
 
         "已經存在!")
 
   Else
 
      *!*            Messagebox("Error1 " + Str (iLastError))
 
      opendoc(vFontName)
 
   Endif
 
   Return
 
Endif
 
 
*-- Add the font to the system font table.
 
iRetVal = AddFontResource (sFOTFile)
 
If iRetVal = 0 Then
 
   iLastError = GetLastError ()
 
   If iLastError = 87 Then
 
      Messagebox("Incorrect Parameter")
 
   Else
 
      *!*            Messagebox("Error2 " + Str (iLastError),16,vFontName)
 
      opendoc(vFontName)
 
   Endif
 
   Return
 
Endif
 
 
*-- Make the font persistent across reboots.
 
Store 0 To iResult, iDisplay
 
iRetVal = RegCreateKeyEx(HKEY_LOCAL_MACHINE, ;
 
   "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", 0, "REG_SZ", ;
 
   0, SECURITY_ACCESS_MASK, 0, @iResult, ;
 
   @iDisplay) && Returns .T. if successful
 
 
*-- Uncomment the following lines to display information
 
*!*   *-- about the results of the function call.
 
*!*      WAIT WINDOW STR(iResult)   && Returns the key handle
 
*!*      WAIT WINDOW STR(iDisplay)  && Returns one of 2 values:
 
*!*                                 && REG_CREATE_NEW_KEY = 1
 
*!*                                 && REG_OPENED_EXISTING_KEY = 2
 
 
iRetVal = RegSetValueEx(iResult, sFontName, 0, 1, sFontFileName, 13)
 
 
*-- Close the key.  Don't keep it open longer than necessary.
 
iRetVal = RegCloseKey(iResult)
 
 
*-- Notify all the other application a new font has been added.
 
iRetVal = SendMessage (HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
 
If iRetVal = 0 Then
 
   iLastError = GetLastError ()
 
   *!*         Messagebox("Error3 " + Str (iLastError))
 
   opendoc(vFontName)
 
   Return
 
Endif
 
 
Erase (sFOTFile)
 
*-- Code ends here
 
Messagebox(sFontDir + sFontFileName,64,"字型安裝完成")
 
Return
 
 | 	  
 
 
版權聲明,上述程式碼不是我寫的,但來源忘記了,功勞歸於原作者。 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		goodnight
 
  
  註冊時間: 2008-10-13 文章: 473 來自: 台南市
  第 12 樓
  | 
		 | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
  	 
	    
  	   | 
 	
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
  | 
   
  
		 |