Jump to content

Facing problem with Autoit script if i schedule it using windows scheduler


Recommended Posts

I am bit new to Autoit.

I have written a script which will check if a particular application(SAS Dataflux studio) is up and running.

This activity is part of our daily routine check and we have been checking it manually by opening the appln and exiting.

I just wanted to automate this task using AUTOIT script.

It works fine if i run the script by double click.But it gives error when scheduling it using the windows scheduler.

It throws error when i try to perform menu exit using SEND(!F) and SEND("X") for exiting the application.

The error says that 'Windows scheduler is unable to write to the application'.

Can anyone please help me with this.

Script which i wrote :

Local $var_1, $var_2, $var_3, $var_4

Run("C:\Program Files\DataFlux\dfPower Studio\7.1\bin\dfNavigator.exe")

$var_1=@error

WinWaitActive ("dfPower Studio")

$var_2=@error

Sleep(2000)

$var_3=@error

Send("!S") ;Open menu to exit

Send("X") ;exit shot cut

$var_4=@error

MsgBox(0, "Example", "Value of variables are " & $var_1 & $var_2 & $var_3 & $var_4)

Link to comment
Share on other sites

The main problem with Scheduler is that it runs processes under the System account instead of the current user. This can lead to problems with permissions, and with network access. I imagine your trouble is in this area.

You could try two things; set the scheduler item to run the script under a user's credentials, or use RunAsSet() to change the credentials used by the Run() statement.

Both of these raise the issue that the password on the account must not change or expire.

Though, my preferred approach is to make the script self-sheduling by including a simple time/date routine. I find this more reliable.

Link to comment
Share on other sites

  • 2 weeks later...

The main problem with Scheduler is that it runs processes under the System account instead of the current user. This can lead to problems with permissions, and with network access. I imagine your trouble is in this area.

You could try two things; set the scheduler item to run the script under a user's credentials, or use RunAsSet() to change the credentials used by the Run() statement.

Both of these raise the issue that the password on the account must not change or expire.

Though, my preferred approach is to make the script self-sheduling by including a simple time/date routine. I find this more reliable.

Dear Anteaus,

Thanks for your input.I think the problem is not due to user credentials as i am supplying the credentials while scheduling it in the windows scheduler.

Can you give me more inputs how we can make the scripts self scheduling?

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