Jump to content

Recommended Posts

Posted

I'd like to preface this by saying that I am very new to both AutoIT and Windows Task Scheduler.

I need to be able to make and run tasks with each task running a script and that will run the scripts at different times (Examples: 6:36pm, 8:40pm, etc.). These scripts will create screenshots and save them on a network folder. I then need to take those screenshots from that folder and run tasks that will send the screenshots to multiple people through email.

I'm made the scripts to make the screenshots just fine. Where I am stuck on is that I'm not able to get the scripts to run through Task Scheduler and I'm not quite sure how to get an email task to work.

In my attempt to create a task that will run a script, I receive the prompt that asks what I want to open the file then. After choosing AutoIt v3 Script, I receive the error shown below. 

 

5b77bae85b859_Capture1.PNG.32e96490f90c25b4d4bca9e19ff3b132.PNG5b77bae69b719_Capture2.PNG.24cb113d53f192b387c2a91902a4d8c0.PNG5b77bae776383_Capture3.PNG.6c55eecf0bf4a86e3d99523dac2a0e5d.PNG

Here is an example of one of the scripts that I am running:

#include <ScreenCapture.au3>

Local $networkSharePath = "\\networkname\Folder\12 am.jpg"
_ScreenCapture_Capture ( $networkSharePath, 0, 0)

Posted

The code of the script that I used is this (not showing exact folder path):

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.5
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------
#include <ScreenCapture.au3>

Local $networkSharePath = "\\networdname\Shared\statename\Attendance System\KPI Tracking\computername\6 36 am.jpg"
_ScreenCapture_Capture ( $networkSharePath, 0, 0)

  • Moderators
Posted (edited)

@mniek91 is that the whole of your script? If not, rather than doling out the script two lines at a time and having us try to guess, how about posting it in its entirety?

 

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

Update:

So I compiled the script into an .exe file. When I run that through task scheduler, it will run but the screenshot that is created just shows a black screen.

Posted

Update 2:

Ok, now the compiled script will produce a screenshot, but it doesn't capture the entire screen. Do I need to add more lines to the script for the compiled .exe to work?

Posted

Update 3:

I also figured out that I can run the script as an au3 file through Task Scheduler by adding the program to run it on in Program/script. However, that also gives me an incomplete screenshot.

Posted

Update 4:

I've got the screenshot parameters in the scripts set up now to where it will capture the whole screen. I've compiled the script and now it will run via Task Scheduler perfectly.

Now when I try to run a task to send the screenshot in an email, I receive this:

6 36 am.jpg

Posted (edited)

@FrancescoDiMuro

That is what the screenshot looks like when it is sent as an email attachment through Task Scheduler. Since this part is probably not AutoIT related, could you or anyone else point me to where I might find a solution to this?

Edited by mniek91
Posted

I've been asking about this issue on the Microsoft forum and the person that has been replying back is suggesting that I have the script run the email part.

Is there a script that, when ran, will pull a captured screenshot from a network folder and send it out through Outlook email?

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
  • Recently Browsing   0 members

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