NotAviable Posted September 15, 2023 Share Posted September 15, 2023 (edited) Hi all, I have a strange behaviour with Run() function, I had a script that suddenly ceased to work. It called a program on another drive, already mounted. Function returns 0, @error 1, @extended 193. Local $res=Run("J:\other\folder\myprogram.exe", "") If I launch the program clicking on its exe file it opens normally, and so using a link. I tried creating a symlink on drive C, and passing by this escamotage Run() works. Local $res=Run("C:\anotherfolder\myprogram.exe", "") Using a normal link (on C) and launching it with ShellExecute it also works. Local $res=ShellExecute("C:\someotherfolder\myprogram.lnk") (I also tried using FileChangeDir() or setting working directory as suggested in another thread, but it donesn't work too) Maybe it was a Windows Update, or a change in policies by administrators, I don't know. Someone has a clue? Thank you, Edited September 15, 2023 by NotAviable better explanation Link to comment Share on other sites More sharing options...
NotAviable Posted September 15, 2023 Author Share Posted September 15, 2023 (edited) I found this topic, where SmOke_N suggests this code: ShellExecute("Drive Leter:\PathToYahooDirectory\YahooMessenger.exe") Only 2 points: I find it strange that one day it suddenly stopped working (I haven't changed AutoIt version) it's a solution, but non intuitive, I think I should use Run() If you feel this topic should be closed it isn't a problem, but I would appreciate if there's an explanation. Thank you Edited September 15, 2023 by NotAviable small correction Link to comment Share on other sites More sharing options...
OJBakker Posted September 15, 2023 Share Posted September 15, 2023 The most likely cause of your problem is not setting the working directory for the program. Try: Local $res=Run("J:\other\folder\myprogram.exe", "J:\other\folder") Link to comment Share on other sites More sharing options...
NotAviable Posted October 1, 2023 Author Share Posted October 1, 2023 (edited) Thank you, it doesn't work. It works only if it is on disk C If it is on another disk it doesn't work, even setting working directory (being that of the executable, as in your example, or in another one, Documents folder under C). What I haven't said is that other partition, where executable is, in mounted (it is an encrypted volume), but I don't think this is a problem, because program can normally be launched if I double click on it (or use a link). Yes, what is strange is that it suddenly stopped working, that's very strange. Thank you anyway Edited October 1, 2023 by NotAviable 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