Sign in to follow this  
Followers 0
rayzer

Harware/Software Interrupts.

15 posts in this topic

Good evening once more.

Is it possible to run a script without hardware/software interruption with the exception of allowing the user to exit a script in the usual way via the task tray icon?

For argument sake I place a script in the startup folder and due to a number of other processes starting at the same time and/or an automatic virus scan is started, the script will not execute properly. Same would be if a user clicked his or her mouse on any window opening, the script would fail.

I would like the script to run regardless, please help.

:)

Share this post


Link to post
Share on other sites



Good evening once more.

Is it possible to run a script without hardware/software interruption with the exception of allowing the user to exit a script in the usual way via the task tray icon?

For argument sake I place a script in the startup folder and due to a number of other processes starting at the same time and/or an automatic virus scan is started, the script will not execute properly. Same would be if a user clicked his or her mouse on any window opening, the script would fail.

I would like the script to run regardless, please help.

:)

Some issues with your question:

First off, is the issue that the script doesn't work properly? Or is it that other processes cause it to fail (which means it isn't written properly)? Or is it that the automatic-virus scanner hasn't been updated with current virus defs, so when your script loads before the virus scanner it automatically stops it?

Which one is the case?

Lastly, if your script is so important that it must be ran on startup, consider making it a service instead of a normally executed program. Check the FAQ on this forum about how to make your script a service (IIRC it's question #4). Service scripts will run, regardless of what the user does, or what the computer does.

But, pay special attention to the bolded question there, as that may actually be your issue.

Other than that, can you provide more detail, or a copy of the script for us to ensure it is working ok?


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Some issues with your question:

First off, is the issue that the script doesn't work properly? Or is it that other processes cause it to fail (which means it isn't written properly)? Or is it that the automatic-virus scanner hasn't been updated with current virus defs, so when your script loads before the virus scanner it automatically stops it?

Which one is the case?

Lastly, if your script is so important that it must be ran on startup, consider making it a service instead of a normally executed program. Check the FAQ on this forum about how to make your script a service (IIRC it's question #4). Service scripts will run, regardless of what the user does, or what the computer does.

But, pay special attention to the bolded question there, as that may actually be your issue.

Other than that, can you provide more detail, or a copy of the script for us to ensure it is working ok?

The script is being used on a works PC which I have full privileges for.

The script works flawlessly under normal system conditions, the problems arise if a remote virus scan is activated when the script is in process. Or, running the script at startup fails due to the sheer number of processes starting at once (I have to wait until its idle). I hope that makes sense.

So in answer to some of your questions.

1. Yes the script works.

2. Its written properly (well to my ability as a first timer)

3. The virus scanner is scheduled and not controlled by me, its updated everyday. If the script runs during the scan, automated text such as username/password/menu navigation, goes out of sequence. It does not flag the script in anyway.

4. It doesn't have to run at startup, but it would be preferable.

5. "Service scripts will run, regardless of what the user does, or what the computer does". That sounds exactly what I'm looking for. :)

Thanks for taking the time to reply to my post.

___

Can a mod alter my typo in the thread title please. :(

Share this post


Link to post
Share on other sites

The script is being used on a works PC which I have full privileges for.

The script works flawlessly under normal system conditions, the problems arise if a remote virus scan is activated when the script is in process. Or, running the script at startup fails due to the sheer number of processes starting at once (I have to wait until its idle). I hope that makes sense.

So in answer to some of your questions.

1. Yes the script works.

2. Its written properly (well to my ability as a first timer)

3. The virus scanner is scheduled and not controlled by me, its updated everyday. If the script runs during the scan, automated text such as username/password/menu navigation, goes out of sequence. It does not flag the script in anyway.

4. It doesn't have to run at startup, but it would be preferable.

5. "Service scripts will run, regardless of what the user does, or what the computer does". That sounds exactly what I'm looking for. :)

Thanks for taking the time to reply to my post.

___

Can a mod alter my typo in the thread title please. :(

I have to be honest here, if your script breaks when a remote virus scan is activated then.......i'd love to see your script lol


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

I have to be honest here, if your script breaks when a remote virus scan is activated then.......i'd love to see your script lol

It doesn't stop, the text input goes out of sequence therefore not logging the user in, or 'a' screen does not move to the correct position (random things). As I said, it works flawlessly under normal/idle system conditions.

$g_szVersion = "Title of Script";checks to see if a single instance of the script is running
If WinExists($g_szVersion) Then Exit 
AutoItWinSetTitle($g_szVersion)
ToolTip ( "Please do not touch the mouse or make any keystrokes whilst your preferences are being set.", 1675, 1021, "Name", 1, 4 )
sleep (2000)
Opt("WinTitleMatchMode", 4)
Run ( "C:\Program Files\Tun\Emul\emul32.exe CS3-v3.cfg" );path/application to run
Sleep( 1000 );  Sleep for a second or two, however long it takes to ensure that the program you just ran is now the active window
$hWnd = WinGetHandle( "CS3-v3 - Tun EMUL - [CS3v3]" ); Get a handle to the active window.  This will be unique, no matter what the Title is.  This way you ensure your script won't become confused by the same Window Title.
WinMove($hWnd, "CS3-v3 - Tun EMUL - [CS3v3]", 0, 0, 652, 483 );windows position co-ords
Sleep ( 2000 )
Send ( "xxx" );username
Sleep ( 1000 )
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "xxx" );password
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "{up}" );keypress to 'Ran Enquiry'
Send ( "{right}" );keypress to 'Ran Enquiry'
Send ( "{down}" );keypress to 'Ran Enquiry'
Send ( "{right}" );keypress to 'Ran Enquiry'
Sleep ( 2000 )
Run ( "C:\Program Files\Tun\Emul\emul32.exe CS3-v3.cfg" );path/application to run
Sleep( 1000 );  Sleep for a second or two, however long it takes to ensure that the program you just ran is now the active window
$hWnd = WinGetHandle( "CS3-v3 - Tun EMUL - [CS3v3]" ); Get a handle to the active window.  This will be unique, no matter what the Title is.  This way you ensure your script won't become confused by the same Window Title.
WinMove($hWnd, "CS3-v3 - Tun EMUL - [CS3v3]", 372, 0, 652, 483 );windows position co-ords
Sleep ( 2000 )
Send ( "xxx" );username
Sleep ( 1000 )
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "xxx" );password
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "{down}" );keypress to 'Receipts'
Send ( "{right}" );keypress to 'Receipts'
Send ( "{down 2}" );keypress to 'Receipts'
Send ( "{right 2}" );keypress to 'Receipts'
Send ( "{up}" );keypress to 'Receipts'
Send ( "{right}" );keypress to 'Receipts'
Sleep ( 2000 )
Run ( "C:\Program Files\Tun\Emul\emul32.exe CS3-v3.cfg" );path/application to run
Sleep( 1000 );  Sleep for a second or two, however long it takes to ensure that the program you just ran is now the active window
$hWnd = WinGetHandle( "CS3-v3 - Tun EMUL - [CS3v3]" ); Get a handle to the active window.  This will be unique, no matter what the Title is.  This way you ensure your script won't become confused by the same Window Title.
WinMove($hWnd, "CS3-v3 - Tun EMUL - [CS3v3]", 372, 266, 652, 483 );windows position co-ords
Sleep ( 2000 )
Send ( "xxx" );username
Sleep ( 1000 )
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "xxx" );password
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "{down}" );keypress to 'Transfers'
Send ( "{right}" );keypress to 'Transfers'
Send ( "{down}" );keypress to 'Transfers'
Send ( "{right 3}" );keypress to 'Transfers'
Sleep ( 2000 )
Run ( "C:\Program Files\Tun\Emul\emul32.exe CS3-v3.cfg" );path/application to run
Sleep( 1000 );  Sleep for a second or two, however long it takes to ensure that the program you just ran is now the active window
$hWnd = WinGetHandle( "CS3-v3 - Tun EMUL - [CS3v3]" ); Get a handle to the active window.  This will be unique, no matter what the Title is.  This way you ensure your script won't become confused by the same Window Title.
WinMove($hWnd, "CS3-v3 - Tun EMUL - [CS3v3]", 372, 266, 652, 483 );windows position co-ords
Sleep ( 2000 )
Send ( "xxx" );username
Sleep ( 1000 )
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "xxx" );password
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "{down}" );keypress to 'Stock Enquiry'
Send ( "{right}" );keypress to 'Stock Enquiry'
Send ( "{down}" );keypress to 'Stock Enquiry'
Send ( "{right}" );keypress to 'Stock Enquiry'
Send ( "{down}" );keypress to 'Stock Enquiry'
Send ( "{right}" );keypress to 'Stock Enquiry'
Send ( "{down}" );keypress to 'Stock Enquiry'
Send ( "{right}" );keypress to 'Stock Enquiry'
Send ( "{f9}" );keypress to 'Stock Enquiry'
Sleep ( 2000 )
Run ( "C:\Program Files\Tun\Emul\emul32.exe CS3-v3.cfg" );path/application to run
Sleep( 1000 );  Sleep for a second or two, however long it takes to ensure that the program you just ran is now the active window
$hWnd = WinGetHandle( "CS3-v3 - Tun EMUL - [CS3v3]" ); Get a handle to the active window.  This will be unique, no matter what the Title is.  This way you ensure your script won't become confused by the same Window Title.
WinMove($hWnd, "CS3-v3 - Tun EMUL - [CS3v3]", 372, 266, 652, 483 );windows position co-ords
Sleep ( 2000 )
Send ( "xxx" );username
Sleep ( 1000 )
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "xxx" );password
Send ( "{enter}" )
Sleep ( 1000 )
Send ( "{down}" );keypress to 'Copy Stock To Warehouse'
Send ( "{right}" );keypress to 'Copy Stock To Warehouse'
Send ( "{down}" );keypress to 'Copy Stock To Warehouse'
Send ( "{right}" );keypress to 'Copy Stock To Warehouse'
Send ( "{down 2 }" );keypress to 'Copy Stock To Warehouse'
Send ( "{right 2}" );keypress to 'Copy Stock To Warehouse'
Sleep ( 2000 )
Run ( "C:\Lotus\Notes\notes.exe" );path/application to run
WinWait ( "Lotus Notes", "" );title of open window
WinActive ( "Lotus Notes", "" )
Sleep ( 1000 )
Send ( "xxx" );password
Send ( "{enter}" )
Sleep ( 2000 )
Send ( "{right}" );keypress to 'email'
Send ( "{enter}" );keypress to 'email'
Send ( "!{w}" );keypress back to main workspace
Send ( "{numpad1}" );keypress back to main workspace
Send ( "{right}" );keypress to 'Stars'
Send ( "{enter}" );keypress to 'Stars'
Sleep ( 1000 )
Run ( "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" );path/application to run
Sleep ( 1000 )
Send ("{enter}")
Exit

Share this post


Link to post
Share on other sites

It doesn't stop, the text input goes out of sequence therefore not logging the user in, or 'a' screen does not move to the correct position (random things). As I said, it works flawlessly under normal/idle system conditions.

Some suggestions for you:

1. If you don't want the user to mess w/ input while the script starts up, use the BlockInput(1) function, and at the end of the script define BlockInput(0)

---->This will still allow your Send() commands to go through; but keyboard/mouse will be disabled for user

2. To see if only 1 instance of your script is running, you should use the _Singleton() function instead of the winactive stuff.

Both of those suggestions are located in the help files :) (tho both may require beta lol)


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Some suggestions for you:

1. If you don't want the user to mess w/ input while the script starts up, use the BlockInput(1) function, and at the end of the script define BlockInput(0)

---->This will still allow your Send() commands to go through; but keyboard/mouse will be disabled for user

2. To see if only 1 instance of your script is running, you should use the _Singleton() function instead of the winactive stuff.

Both of those suggestions are located in the help files :) (tho both may require beta lol)

Cheers, I'll put them in to practice. :(

Share this post


Link to post
Share on other sites

Part of the solution is now in place thanks to the blockinput function, I have also changed the top of the script using the singleton as advised. :)

I've hit a brick wall though, using srvany.exe and PTREX's nice application to create a service, it still messes up when windows boots. The common errors are either a window does not open/move to the correct position or more commonly, the text input goes out of sequence. In other words. One window opens to input the username and password fine. The next one attempts to put the username and password in twice (like jumping the sequence).

Anyone with the knowledge to allow a service/script to function without any interruption would greatly be appreciated. To reiterate, the script works flawlessly if executed AFTER windows is loaded and idle (no other processes loading or AV software scanning). If the latter occurs, the script fails. :D

In the mean time, I'll keep researching :(

Share this post


Link to post
Share on other sites

Part of the solution is now in place thanks to the blockinput function, I have also changed the top of the script using the singleton as advised. :(

I've hit a brick wall though, using srvany.exe and PTREX's nice application to create a service, it still messes up when windows boots. The common errors are either a window does not open/move to the correct position or more commonly, the text input goes out of sequence. In other words. One window opens to input the username and password fine. The next one attempts to put the username and password in twice (like jumping the sequence).

Anyone with the knowledge to allow a service/script to function without any interruption would greatly be appreciated. To reiterate, the script works flawlessly if executed AFTER windows is loaded and idle (no other processes loading or AV software scanning). If the latter occurs, the script fails. :D

In the mean time, I'll keep researching :D

Bump! :)

Share this post


Link to post
Share on other sites

Guys, I'm sorry to keep bumping this but I need a solution if possible. Well, its better than creating a new thread. :)

How is it possible to isolate the script so that it runs without any interruption from any other loading processes and/or running AV scanners.

Rtvscan.exe and Vulscan.exe are remotely started every morning and those mainly are stopping my script from functioning flawlessly.

Share this post


Link to post
Share on other sites

Arrgghh.

Seriously is there another way... I won't stop until someone at least points me in the right direction. :)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

You have been most helpful. :) Even acknowledging by saying yes or no would prevent further research after already spending four days doing so.

[/Frustrated]

Edited by rayzer

Share this post


Link to post
Share on other sites

Check the AutoIt3 help file for ProcessWait, then think about how that could help you make certain that your Windows session is in a predictable state before continuing with the rest of your script (I've tested for explorer.exe in the past to make certain that the Desktop is visible).

You seem kind of critical of the quality of help you're getting here on the forum. This is is peer-prestige driven group, you have to learn to engage people based on that.


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

I think that maybe you need to have a look at ControlSend(),ControlFocus(),ControlSetText() infact look in the Helpfile at Control... and you will see numerous functions to help you.

This is going to make things a little more complicated in your script but will hopefully be more reliable than doing mouse clicks and send()'s.

With ControlSend() etc you specify the windowTitle or handle, window text or put "" if you don't need to specify some text that appears ont he window, then you will need to specify the control id for the control you wish to interact with. This is where you use the AutoIt window info tool, You can hover over the controls to see there control ID. Once you know the ID you then specify the data to be sent.

This will be a much more reliable method then just using Send()

Also this

Run ( "C:\Program Files\Tun\Emul\emul32.exe CS3-v3.cfg" );path/application to run
Sleep( 1000 );  Sleep for a second or two, however long it takes to ensure that the program you just ran is now the active window
$hWnd = WinGetHandle( "CS3-v3 - Tun EMUL - [CS3v3]" ); Get a handle to the active window.  This will be unique, no matter what the Title is.  This way you ensure your script won't become confused by the same Window Title.

Rather than sleep() use WinWait()

Run ( "C:\Program Files\Tun\Emul\emul32.exe CS3-v3.cfg" );path/application to run
WinWait("CS3-v3 - Tun EMUL - [CS3v3]"); Wait for the app to start
$hWnd = WinGetHandle( "CS3-v3 - Tun EMUL - [CS3v3]" ); Get a handle to the active window.  This will be unique, no matter what the Title is.  This way you ensure your script won't become confused by the same Window Title.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Check the AutoIt3 help file for ProcessWait, then think about how that could help you make certain that your Windows session is in a predictable state before continuing with the rest of your script (I've tested for explorer.exe in the past to make certain that the Desktop is visible).

You seem kind of critical of the quality of help you're getting here on the forum. This is is peer-prestige driven group, you have to learn to engage people based on that.

Dave,

Thanks my friend. Admittedly I was frustrated at the lack of response to my question as opposed to being critical, I know you guys do a fantastic job on here. All I wanted was a direction, a hint. Not the answer. :) I had researched to the point of hitting the same brickwall over and over and just needed to find a 'light'. Now I have suggestions by Chris and yourself to go by and develop the script better to my requirements.

So thanks again.

:)

Great stuff, Chris. I'll be looking into it over the coming weekend. :)

Edited by rayzer

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
Sign in to follow this  
Followers 0