Jump to content

AutoIt error


Recommended Posts

  • Developers

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

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

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 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

  • Developers

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

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

  • Developers

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

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 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!

for(loop=0; loop<infinity; loop++) { alert('I love you'); }

Link to comment
Share on other sites

  • Developers

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 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

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

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

  • Developers

I am wondering if you now also understand why is wasn't working and understand what the Work Directory is?

Enjoy,

Jos :mellow:

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

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

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 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

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. :mellow:

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...