madasraka Posted October 2, 2010 Share Posted October 2, 2010 I have simple script utilizing CMD Xcopy commands This simple script is compiled and made to xcopy files from one place to its root. I also made new script which executes previously described compiled script as well as other CMD.bat files and many other executables. Execution is done simply by Run (@ComSpec & ' /c ' & '"' & IniRead (@ScriptDir & "\Settings.ini","Components","Path1","") & '"') or Run (IniRead (@ScriptDir & "\Settings.ini","Components","Path1","")) ISSUE: Executed script's or *.bat think that they located at where my script is (which i use to execute them) For example: C:\Executor.au3 executes D:\test.bat test.bat has simple lines mkdir folder Xcopy %source%\folder\file.ext When this test.bat executed, CMD window says that this batch runs from C: instead of D: where its located and copies files into C:\folder instead of D:\folder as it was programed to. Anyway to fix this ? Maybe rights issue or something ? Thanks in advance Link to comment Share on other sites More sharing options...
madasraka Posted October 2, 2010 Author Share Posted October 2, 2010 Maybe i somehow need to convert full path to executable batch to path only and set it as its working directory ? But i dont know how to convert F:\Installed programs\Azureus\Start Azureus.bat to F:\Installed programs\Azureus Link to comment Share on other sites More sharing options...
Developers Jos Posted October 2, 2010 Developers Share Posted October 2, 2010 _PathSplit() ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
madasraka Posted October 2, 2010 Author Share Posted October 2, 2010 (edited) thanks i didnt know this function existed and was in help file. Dim $szDrive1, $szDir1, $szFName1, $szExt1 $GetPath1 = _PathSplit(IniRead (@ScriptDir & "\Settings.ini","Components","Path1",""), $szDrive1, $szDir1, $szFName1, $szExt1) $ReturnPath1 = _ArrayToString ($GetPath1,"",1,2) Run (IniRead (@ScriptDir & "\Settings.ini","Components","Path1",""),$ReturnPath1) I created this code for each 10 fileopen dialogs and i wonder if there is another simpler way to make this code smaller. I do not yet understand how "Dim" works and whats its for, so if anyone would explain it would be great help. Thanks again for function Edited October 2, 2010 by madasraka Link to comment Share on other sites More sharing options...
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