Write CMD output to file as UTF-8 - Macro Scheduler Forums
文章推薦指數: 80 %
/s /b /o:gn /A-D > "%FILE_ROOT_PATH%\results.txt" The first part is to set the output format to UTF-8 (chcp 65001) The & tells the command ... Home(current) Products MacroSchedulerStandard MacroSchedulerPro MacroSchedulerLite ProEnterprisePack SimpleMacroRecorder SoftwareDevelopmentKit BuyNow Support KnowledgeBase VideoTutorials CommunityForums ContactUs Blog UserArea Search Quicklinks Unansweredtopics Activetopics Search Theteam FAQ Login Register Boardindex MacroScheduler ScriptsandTips Search WriteCMDoutputtofileasUTF-8 Examplescriptsandtips(replacesOldScripts&Tipsarchive) Moderators:Dorian(MJTsupport),JRL,PhilPendlebury PostReply Search Advancedsearch 1post •Page1of1 Grovkillen AutomationWizard Posts:810Joined:FriAug10,20122:38pm Location:Hudiksvall,Sweden Contact: ContactGrovkillen Website WriteCMDoutputtofileasUTF-8 Quote Post byGrovkillen»MonOct05,20206:56am IhavehadalongtimenagwithmycommandlineoutputtofilebeingnotUTF-8.Ihavenowfoundthesolutiontomyproblem. Code:SelectallLet>FILE_ROOT_PATH=X:\your\path RunProgram>cmd/cchcp65001>nul&cmd/cdir"%FILE_ROOT_PATH%\*.*"/s/b/o:gn/A-D>"%FILE_ROOT_PATH%\results.txt" Tobreakitdown... cmd/cchcp65001>nul & cmd/cdir"%FILE_ROOT_PATH%\*.*"/s/b/o:gn/A-D>"%FILE_ROOT_PATH%\results.txt" ThefirstpartistosettheoutputformattoUTF-8(chcp65001) The&tellsthecommandprompttoexecutethenextpartinthesamerunasthefirst Thethirdpartisthestandardfiledircommandwiththefollowingswitches: /s=listfilesinsubfoldersaswell /b=removetheheaderandfooterpartoftheoutput /o:gn=sortthelistalphabetically /A-D=onlylistfiles Let>ME=%Script% Running:15.0.20 versionhistory Top PostReply 1post •Page1of1 Returnto“ScriptsandTips” Jumpto GeneralandInfo ↳ TheWaterCooler MacroScheduler ↳ Technical/Scripting ↳ GeneralDiscussion ↳ Beginners ↳ ScriptsandTips ↳ EnhancementSuggestions ↳ MacroSchedulerConsultants Boardindex AlltimesareUTC Deleteallboardcookies Theteam Contactus PoweredbyphpBB®ForumSoftware©phpBBLimited Signuptoournewsletterforfreeautomationtips,tricks&discounts Sign uptoournewsletterforfreeautomationtips,tricks& discounts
延伸文章資訊
- 1Save text file in UTF-8 encoding using cmd.exe - Exchangetuts
How do I change the Encoding to UTF-8?
- 2How do I export command prompt results to text file?
Right click -> New -> Text Document. Open it, and do NOT type anything into it. Go to File -> Sav...
- 3windows cmd視窗,輸出UTF-8格式檔案,顯示亂碼 - 程式人生
可以嘗試在CMD視窗中檢視一個utf-8格式的檔案type <filename.txt>. 如果需要切換回GBK chcp 936 可以換回預設的GBK chcp 437 是美國英語.
- 4Converting text file to UTF-8 on Windows command prompt
I need to convert a text file to utf-8 format via windows command prompt. You can easily do this ...
- 5windows - Save text file in UTF-8 encoding using cmd.exe
The default encoding for command prompt is Windows-1252. Change the code page (chcp command) to 6...