Jump to content

Run() doesn't run a program on another drive


NotAviable
 Share

Recommended Posts

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 by NotAviable
better explanation
Link to comment
Share on other sites

I found this topic, where SmOke_N suggests this code:

ShellExecute("Drive Leter:\PathToYahooDirectory\YahooMessenger.exe")

 

Only 2 points:

  1. I find it strange that one day it suddenly stopped working (I haven't changed AutoIt version)
  2. 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 by NotAviable
small correction
Link to comment
Share on other sites

  • 3 weeks later...

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 by NotAviable
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...