Write CMD output to file as UTF-8 - Macro Scheduler Forums

文章推薦指數: 80 %
投票人數:10人

/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



請為這篇文章評分?