Developers Jos Posted May 30, 2010 Developers Share Posted May 30, 2010 What is the Workdir when it start the first time? You have just the file name so the downloaded file will be stored in the workdir. 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...
nht3004 Posted May 30, 2010 Author Share Posted May 30, 2010 What is the Workdir when it start the first time? You have just the file name so the downloaded file will be stored in the workdir.I always use @ScriptDir&"\"&"name of program" :|, and I put the download file in the same level of the directory which contains the file >"<! Please give me some advice! for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
GEOSoft Posted May 30, 2010 Share Posted May 30, 2010 (edited) If I understand you correctly, you are attempting to run this at windows startup. If that is correct then I think I know where the problem is and it has nothing to do with the script. Try loading Windows and then wait a couple of minutes before running the script. Does it work now? Edited May 30, 2010 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Developers Jos Posted May 30, 2010 Developers Share Posted May 30, 2010 I always use @ScriptDir&"\"&"name of program" :|, and I put the download file in the same level of the directory which contains the file >"<! Please give me some advice! this is not what you posted scriptline showed ...right? InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "Command.enht", "", 0); 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...
nht3004 Posted May 30, 2010 Author Share Posted May 30, 2010 this is not what you posted scriptline showed ...right? InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "Command.enht", "", 0); That's the code I try and did not work, even it is quite simple ! I have tried to Sleep (10000) before running but still not work! But this is work: I make a file call index.exe Run("download.exe",@ScriptDir); I make another program and call for that program, it works without delaying! So what is the problem? for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
Developers Jos Posted May 30, 2010 Developers Share Posted May 30, 2010 That's the code I try and did not work, even it is quite simple !Ok, change that simple code to contain the full path information to the scriptdir for the output file since that is currently not in there. 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...
nht3004 Posted May 30, 2010 Author Share Posted May 30, 2010 Ok, change that simple code to contain the full path information to the scriptdir for the output file since that is currently not in there.I think you didnt get what I meanNow create a file name download.exeInetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "Command.enht", "", 0);Then you make that run when windows startup by adding value to regedit, create shortcut to startup folder.... or anything you like, just for starting with windows.And test, it won't work!But when you start it again, it works!^^, weird! for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
Developers Jos Posted May 30, 2010 Developers Share Posted May 30, 2010 (edited) I think you didnt get what I mean Now create a file name download.exe InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "Command.enht", "", 0); Then you make that run when windows startup by adding value to regedit, create shortcut to startup folder.... or anything you like, just for starting with windows. And test, it won't work! But when you start it again, it works! ^^, weird! I think I understand but believe you do not. Change this line to contain the full path to the target file: InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "drive:\path\Command.enht", "", 0) -or- InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", @ScriptDir & "\Command.enht", "", 0) Or add this line to it first: FileChangeDir(@scriptdir) InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "Command.enht", "", 0) Edited May 30, 2010 by Jos 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...
GEOSoft Posted May 30, 2010 Share Posted May 30, 2010 Sleep(1000) probably wouldn't be enough time to overcome the problem I was thinking of in my last post. I was thinking you could be trying to get the download before you had an active network connection. Also, just to play it safe, put this at the top of your script FileChangeDir(@ScriptDir) You may have fallen victim to a common misconception about working directories. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
nht3004 Posted May 30, 2010 Author Share Posted May 30, 2010 I think I understand but believe you do not. Change this line to contain the full path to the target file: InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "drive:\path\Command.enht", "", 0) -or- InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", @ScriptDir & "\Command.enht", "", 0) Or add this line to it first: FileChangeDir(@scriptdir) InetGet("http://dl.dropbox.com/u/7556171/TU/Command.enht", "Command.enht", "", 0) Sleep(1000) probably wouldn't be enough time to overcome the problem I was thinking of in my last post. I was thinking you could be trying to get the download before you had an active network connection. Also, just to play it safe, put this at the top of your script FileChangeDir(@ScriptDir) You may have fallen victim to a common misconception about working directories. Thank you all, I figure it out ^^, just make full path, thanks everyone for helping me, close topic here ^^! for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
Developers Jos Posted May 30, 2010 Developers Share Posted May 30, 2010 I am wondering if you now also understand why is wasn't working and understand what the Work Directory is? Enjoy, Jos 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...
GEOSoft Posted May 30, 2010 Share Posted May 30, 2010 It's amazing how many people don't understand working directories Jos. I've been fighting that uphill battle on forums for years now. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Baraoic Posted May 30, 2010 Share Posted May 30, 2010 So what is the working directory it was using when it first started? Link to comment Share on other sites More sharing options...
GEOSoft Posted May 31, 2010 Share Posted May 31, 2010 (edited) Normally the User profile directory. To find out, just open a command prompt window and see where it's starting. Edit: As a matter of fact, if you do a search you will probably find that your "missing" file is not missing at all, it just isn't where you thought it would be. Edited May 31, 2010 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
bo8ster Posted May 31, 2010 Share Posted May 31, 2010 It's amazing how many people don't understand working directories Jos. I've been fighting that uphill battle on forums for years now.Then there is the concept of the 'path'. People asking why Run("notepad.exe") works but Run("customapp.exe") does not work for them.It is a big hill. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] 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