-1

I created an AutoIt script to install my executable. But when I run it, nothing is executed. My script:

Run("agent.exe", "C:\temp")

After saving and compiling (using Ctrl + F7), nothing is executed. Why?

user4157124
  • 2,809
  • 13
  • 27
  • 42
Natasha
  • 507
  • 2
  • 7
  • 12

2 Answers2

1

Try this:

Run("C:\temp\agent.exe")

Your code is telling it to run agent.exe in the current directory and telling agent.exe to use C:\temp as its working directory.

09stephenb
  • 9,358
  • 15
  • 53
  • 91
0

It is recommended to use absolute paths. Otherwise you may end up in a situations like this one.

By using just a filename "agent.exe" your script assumes that the file is in the current working directory. This is fine as far as the working dir doesn't change.

Use this For example:

Run (@ScriptDir & "\agent.exe", @HomeDrive & "\temp")
Milos
  • 2,927
  • 1
  • 15
  • 27