0
votes

What do I need to do to run a SAVED notepad file? Current code is this:

Run("Notepad.exe", "C:\Users\Caleb Austing\Documents\AutoIT\Alphas\TFRO Hub Welcome Pack\TFRO Hub Update Log.txt")

I have also got:

Run("notepad.exe", @ScriptDir & "TFRO Hub Update Log.txt")

Which is all a part of:

Func StartUpdatelog()
    Run("notepad.exe", @ScriptDir & "TFRO Hub Update Log.txt")

EndFunc
1

1 Answers

3
votes

You put the file as the "WorkingDir" argument. That is the problem.

The file must be specified with the program in the Run-Function.

Run("notepad.exe C:\Users\Caleb Austing\Documents\AutoIT\Alphas\TFRO Hub Welcome Pack\TFRO Hub Update Log.txt")

Or

Run("notepad.exe " & @ScriptDir & "\TFRO Hub Update Log.txt")

Or you can use ShellExecute

ShellExecute("notepad.exe", @ScriptDir & "\TFRO Hub Update Log.txt")

Add a backslash before the file name, because the variable @ScriptDir contains the path without a terminating backslash.