Lolita Posted May 1, 2008 Share Posted May 1, 2008 (edited) Hello i have another problem with autoit that i can't solve myself When i start my script from folder where it is it copies file ok, but when i call it directly - ie. i call d:\$OEM$\ie7\force_ie7_reg.exe from runonceex it don't copy files and filecopy function returns filed. How can i solve it? Do i need to use @ScriptDir? And why it work this way? Thanks for your reply Alse i don't know why, but winwait and winwait activate don't work correctly for me in runonceex (but it worked ok before so i think i have problem with my scripts or something autoit beta related), nevermind. Edited May 1, 2008 by Lolita Link to comment Share on other sites More sharing options...
Developers Jos Posted May 1, 2008 Developers Share Posted May 1, 2008 What are the FileCopy statements you use in your script ? Wild guess: One thing that probably will solve your issue is add a FileChangeDir(@scriptdir) at the top of your script. 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...
Lolita Posted May 1, 2008 Author Share Posted May 1, 2008 (edited) Now it is$sysdrive = EnvGet("SystemDrive") MsgBox(0, "debug", "scriptdir: " & @ScriptDir) MsgBox(0, "debug", "sysdrive: " & $sysdrive) if FileCopy(@ScriptDir & "/../regtweaks/IE7.reg", $sysdrive & "\", 9) == 1 Then MsgBox(0, "debug", "copy result: " & "ie7 copy ok") Else MsgBox(0, "debug", "copy result: " & "ie7 copy failed") EndIfBefore i usedFileCopy("/../regtweaks/IE7.reg", $sysdrive & "\", 9)... this probably use "work directory" as it's base path ... Edited May 1, 2008 by Lolita Link to comment Share on other sites More sharing options...
TPlanet Posted May 1, 2008 Share Posted May 1, 2008 (edited) Now it is$sysdrive = EnvGet("SystemDrive") MsgBox(0, "debug", "scriptdir: " & @ScriptDir) MsgBox(0, "debug", "sysdrive: " & $sysdrive) if FileCopy(@ScriptDir & "/../regtweaks/IE7.reg", $sysdrive & "\", 9) == 1 Then MsgBox(0, "debug", "copy result: " & "ie7 copy ok") Else MsgBox(0, "debug", "copy result: " & "ie7 copy failed") EndIfBefore i usedFileCopy("/../regtweaks/IE7.reg", $sysdrive & "\", 9)... this probably use "work directory" as it's base path ... Hi! What does MsgBox(0, "debug", "scriptdir: " & @ScriptDir) give you? Is "/../regtweaks/IE7.reg" in this folder? You Know that @ScriptDir is the folder where the au3/.exe is? Edited May 1, 2008 by TPlanet 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