pcjunki

schedule task inetget

11 posts in this topic

#1 ·  Posted (edited)

I'm trying to schedule task an inetget download in the middle of the night, so I'm not hogging up my bandwidth.
I'm using a ini file to set the url and download location to the pc, ect ect

it runs fine compiled and not compiled

but when I schedule task it to run the compiled file, it does not work

below is my code

$url= IniRead("file_download.ini", "url", "link", "")
$location= IniRead("file_download.ini", "location", "location", "")
$filename= IniRead("file_download.ini", "filename", "filename", "")

InetGet($url, $location & $filename)

 and here is the file_download.ini

[URL]
link=https://www.autoitscript.com/forum/cdn/images/logo_autoit_210x72.svg

[location]
location=c:\users\public\desktop\

[filename]
filename=logo_autoit_210x72.svg

 

Edited by pcjunki

Share this post


Link to post
Share on other sites



Are you sure you have a INet-connection when script runs?

Share this post


Link to post
Share on other sites

yes, after I compile it, I can double click the exe file, and it works fine

Share this post


Link to post
Share on other sites

I would just use a simple msgbox and compile it and see if that works, as that way you can test to see if a simple script can be scheduled - that way you rule out it being an issue with script or issue with scheduling.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

no issue with another script and scheduling.

 

Share this post


Link to post
Share on other sites

Likely is your workdir not equal to the scriptdir when the exe is scheduled, so it can't find the INI.

Jos

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

that was it, I move my 2 files to the root of my disk, and edited the schedule
tada!

 

 

Capture.PNG

Edited by pcjunki

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I probably wouldn't have moved the script but rather change the path to the ini into:

$url= IniRead(@scriptDir & "\file_download.ini", "url", "link", "")

Jos :)

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I like that allot better, adding the @scriptdir, much better

Share this post


Link to post
Share on other sites

If I was you, I would take a look at all the macros, as there are some really nice ones out there.

"The pre-defined macros are generally used to provide easy access to system information like the location of the Windows directory or the name of the logged on user."


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

I know how to use macros, I just couldn't figure out why a compiled script would work when double clicking it, but would not work when schedule tasking it.

I got it to work with @scriptdir

Share this post


Link to post
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