※ 引述《homobibi (homobibi)》之銘言:: 我想寫一個簡單的net use批次檔: 但是有些伺服器資料夾名稱含有簡體字: 例如: @ echo off: net use X: \\192.168.2.xxx\二厂公共区域: 那個區 如果編碼是ANSI就會變亂碼: 改編碼 批次檔又會出現錯誤: 請問這個有解嗎? 1. 在執行命令前用 chcp 65001 切換編碼 2. 將 bat 檔存成 UTF-8 without BOM 格式 3. 如果要在命令提示視窗中顯示結果, 需要在命令提示視窗中 將預設的字型由Raster Fonts改成Lucida Console http://blog.darkthread.net/post-2011-08-11-command-prompt-codepage.aspx ================================ @ echo off chcp 65001 net use X: \\192.168.2.xxx\二厂公共区域 ================================ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.33.151.121
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html
You are receiving this email because you subscribed to this feed at blogtrottr.com.