mniek91 Posted August 18, 2018 Posted August 18, 2018 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. 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)
FrancescoDiMuro Posted August 18, 2018 Posted August 18, 2018 @mniek91 The error attached is not related to the code that you posted Post the code that generates the error. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
mniek91 Posted August 18, 2018 Author Posted August 18, 2018 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)
FrancescoDiMuro Posted August 18, 2018 Posted August 18, 2018 @mniek91 Do you have permissions on that path to read/write files? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
mniek91 Posted August 21, 2018 Author Posted August 21, 2018 Yes, the account has full read-write access.
Moderators JLogan3o13 Posted August 21, 2018 Moderators Posted August 21, 2018 (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 August 21, 2018 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!
mniek91 Posted August 21, 2018 Author Posted August 21, 2018 That is the whole script. I left out the exact names of the folders in the file path for the sake of discretion.
mniek91 Posted August 28, 2018 Author Posted August 28, 2018 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.
mniek91 Posted August 28, 2018 Author Posted August 28, 2018 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?
mniek91 Posted August 28, 2018 Author Posted August 28, 2018 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.
mniek91 Posted August 28, 2018 Author Posted August 28, 2018 Fyi, I am trying to get this all to work on Windows 10.
mniek91 Posted August 28, 2018 Author Posted August 28, 2018 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:
FrancescoDiMuro Posted August 28, 2018 Posted August 28, 2018 @mniek91 What's that? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
mniek91 Posted August 29, 2018 Author Posted August 29, 2018 (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 August 29, 2018 by mniek91
mniek91 Posted August 30, 2018 Author Posted August 30, 2018 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?
jdelaney Posted August 30, 2018 Posted August 30, 2018 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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