Joosh Posted August 2, 2005 Posted August 2, 2005 (edited) Okay, I already know that this is possible with Run("Notepad.exe" "Test.txt") However, this seems to only work if the .txt document is located directly within the main autoit folder I would like to know how i can make it know exactly where the .txt document is and locate it and run it. Any help would be greatly appreciated Edited August 2, 2005 by Joosh
LxP Posted August 2, 2005 Posted August 2, 2005 You could send Notepad a full path like so: Run('Notepad.exe "C:\My Documents\Test.txt"') Or alternatively if you have the filename in a variable: $File = "C:\My Documents\Test.txt" Run('Notepad.exe "' & $File & '"')
Joosh Posted August 2, 2005 Author Posted August 2, 2005 Okay thats helpful in the short term but this program is going to be carted around and moved from computer to computer each time probably being placed in a different directory, the .txt file and .exe file will both be bundled in the same folder, how can i make autoit understand that the .txt file is in the same folder as the .exe that is being run and go from there?
WSCPorts Posted August 2, 2005 Posted August 2, 2005 (edited) $File = @ScriptDir & "\SomeFile.txt" Run('Notepad.exe "' & $File & '"') otherwise in the exe u could place this $file = @WorkingDir & "\SomeFile.txt" Run('Notepad.exe "' & $File & '"') coded with beta .65 @WorkingDir = Current/active working directory. (Result does not contain a trailing backslash) @ScriptDir = Directory containing the running script. (Result does not contain a trailing backslash) have to use a trainling backslash as there isnt one included... Cheers Edited August 2, 2005 by WSCPorts http://www.myclanhosting.com/defiasVisit Join and contribute to a soon to be leader in Custumized tools development in [C# .Net 1.1 ~ 2.0/C/C++/MFC/AutoIt3/Masm32]
Joosh Posted August 2, 2005 Author Posted August 2, 2005 (edited) Thanks heaps mate. Okay and using that how would i call the program $e = @ScriptDir & "\POSRecord.txt" Run($e)???? I am a noobie ^^; Edited August 2, 2005 by Joosh
WSCPorts Posted August 2, 2005 Posted August 2, 2005 (edited) $e = @ScriptDir & "\POSRecord.txt" Run('Notepad.exe "' & $e & '"') Aim im Ban1337 :0_o: Edited August 2, 2005 by WSCPorts http://www.myclanhosting.com/defiasVisit Join and contribute to a soon to be leader in Custumized tools development in [C# .Net 1.1 ~ 2.0/C/C++/MFC/AutoIt3/Masm32]
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