zeffy Posted January 29, 2010 Share Posted January 29, 2010 (edited) . Edited May 21, 2010 by Zef Link to comment Share on other sites More sharing options...
Fire Posted January 29, 2010 Share Posted January 29, 2010 (edited) Hi zeffy.Glad to see you on Autoit Forum.This works for me fine:#include <Array.au3> #include <File.au3> Dim $avarray _FileReadToArray(@ScriptDir & "\language.txt",$avarray) Run("cmd.exe /c " & $avarray[1],@ScriptDir,@SW_HIDE)Here is language.txt file was saved with UTF8 encoding because its content writed in unicode: => əünı.exeScript works fine and have`nt any problems.+ You can use fileinstall() for include your language.txt.I use this method on my native applications.sORRY for my awfull English. Edited January 29, 2010 by Sh3llC043r [size="5"] [/size] Link to comment Share on other sites More sharing options...
zeffy Posted January 29, 2010 Author Share Posted January 29, 2010 Hi zeffy.Glad to see you on Autoit Forum. This works for me fine: #include <Array.au3> #include <File.au3> Dim $avarray _FileReadToArray(@ScriptDir & "\language.txt",$avarray) Run("cmd.exe /c " & $avarray[1],@ScriptDir,@SW_HIDE) Here is language.txt file was saved with UTF8 encoding because its content writed in unicode: => əünı.exe Script works fine and have`nt any problems. + You can use fileinstall() for include your language.txt. I use this method on my native applications. sORRY for my awfull English. That's not really what I mean lol, I have the script encoded with UTF-8 with BOM, but i can't get it to send unicode through Run() or ShellExecute(). Can anyone help me? Link to comment Share on other sites More sharing options...
picea892 Posted January 30, 2010 Share Posted January 30, 2010 Really not sure what you are about. But a third way to run a program #include <Process.au3> $rc = _RunDos("start Http://www.autoitscript.com") Link to comment Share on other sites More sharing options...
MaraskanUser Posted March 5, 2010 Share Posted March 5, 2010 I have a similar problem with IrfanView when trying to open unicode paths through AutoIt. That image viewer opens for example a file in E:\春の朝は寒い\SomeImage.jpg perfectly fine if it's set to do so in the registry: [HKEY_CLASSES_ROOT\IrfanView\shell\open\command] @="\"D:\\Admin\\Common\\IrfanView\\i_view32.exe\" \"%1\"" But it won't do so when being called by Dim $TestPath="E:\春の朝は寒い\SomeImage.jpg" Run ("D:\Admin\Common\IrfanView\i_view32.exe " & $TestPath) Exit The funny thing is, when sending the same file to Word from Autoit, Word is able to see the file in the unicode path. So for Word, the way Autoit is sending the unicode path string makes sense, but for IrfanView it doesn't. IrfanView allegedly has only partial unicode support (only for filenames), and it does handle unicode filenames when called by the shell, but weirdly not from AutoIt. Link to comment Share on other sites More sharing options...
MHz Posted March 5, 2010 Share Posted March 5, 2010 (edited) perfectly fine if it's set to do so in the registry: [HKEY_CLASSES_ROOT\IrfanView\shell\open\command] @="\"D:\\Admin\\Common\\IrfanView\\i_view32.exe\" \"%1\"" The registry parameter being passed above is quoted i.e "%1" But it won't do so when being called by Dim $TestPath="E:\春の朝は寒い\SomeImage.jpg" Run ("D:\Admin\Common\IrfanView\i_view32.exe " & $TestPath) Exit $TestPath above is not quoted. Try the code below Dim $TestPath="E:\春の朝は寒い\SomeImage.jpg" Run ('"D:\Admin\Common\IrfanView\i_view32.exe" "' & $TestPath & '"') Exit Though I do not see white space as your issue. Give Shellexecute() a try with similar syntax as above. Edited March 5, 2010 by MHz Link to comment Share on other sites More sharing options...
MaraskanUser Posted March 6, 2010 Share Posted March 6, 2010 The quotes indeed made the difference - very weird for a path containing no white space, but good to know. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now