Nate21 Posted June 18, 2021 Posted June 18, 2021 I make AutoIt files that set to run few batch files that I need and I use the command below in AutoIt. Runwait("sample.bat",@ScriptDir) Runwait("sample2.bat,@scriptDir) etc.... They works fine if I placed them all in the same folder in the USB drive. But I just want the AutoIt file in the folder by itself. Batch files and everything else in a subfolder, so they don't look so messy and confusing when I need to open AutoIt from a USB drive. But I can't make it to work if I move it to a different folder. Is there a way to do it without specify the whole directory since this is from the USB drive, it could be D, or E drive when plugged into a computer. Thanks
Nine Posted June 18, 2021 Posted June 18, 2021 Maybe ? RunWait("sample.bat",@ScriptDir & "\BatchFolder") “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Solution JockoDundee Posted June 18, 2021 Solution Posted June 18, 2021 Maybe ? RunWait(@ScriptDir & "\BatchFolder\" & "sample.bat") unless script in \ directory, then eliminate leading \ in \BatchFolder Code hard, but don’t hard code...
Nate21 Posted June 18, 2021 Author Posted June 18, 2021 30 minutes ago, JockoDundee said: Maybe ? RunWait(@ScriptDir & "\BatchFolder\" & "sample.bat") unless script in \ directory, then eliminate leading \ in \BatchFolder It works like a charm! You're the man!!!! thank you! thank you! Thank you!
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