detox1978
asked on
EXE Run When Clicked But Not on Scheduled Task
Hi All,
I have a .exe that is stored in C:\BCP\scripts\setup.exe, which runs on a Windows Server 2012 R1
It does a couple things
When i double click it everything works as expected. But when i run it via a scheduled task it errors.
I suspect its a permission issue, but cant see any errors.
Any suggestions.
Many thanks
D
I have a .exe that is stored in C:\BCP\scripts\setup.exe, which runs on a Windows Server 2012 R1
It does a couple things
- Move Files in C:\BCP
- Copy Files in C:\BCP
- Rename Files in C:\BCP
- Create Files in C:\BCP
When i double click it everything works as expected. But when i run it via a scheduled task it errors.
I suspect its a permission issue, but cant see any errors.
Any suggestions.
Many thanks
D
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What does the scheduled task error message say?
You have two places to look for :
- The history tab in the properties of the task
The error code (Last Run Result) on the task : (It's the error code given by the last command executed by the task).
- The history tab in the properties of the task
The error code (Last Run Result) on the task : (It's the error code given by the last command executed by the task).
ASKER
Hi All,
The task runs and i can see the .exe is added to task manager. But it doesnt do what it does when manually clicked.
When the task runs it logs everything that would normally be logged, it just doesnt seem to run as expected...
The task runs and i can see the .exe is added to task manager. But it doesnt do what it does when manually clicked.
When the task runs it logs everything that would normally be logged, it just doesnt seem to run as expected...
ASKER
Managed to get it sorted.
It was a permissions issue.
It was a permissions issue.
I see that the first task is to move files.
From where?
From/for a specific user ?
Are you sure that the program/executable has all the necessary environment (variables, patch, permissions)?
Some programs need the graphical interface to work correctly.
Does it display something when run interactively?
From where?
From/for a specific user ?
Are you sure that the program/executable has all the necessary environment (variables, patch, permissions)?
Some programs need the graphical interface to work correctly.
Does it display something when run interactively?
ASKER
I'm not sure. The .exe must require network authentication of some kind.
I tried moving the file, using a local user without any luck
I tried moving the file, using a local user without any luck
I tried moving the file, using a local user without any luckIt is complicated to use the network with a local account. It often means to indicate login/password (in the script/code) which is a bad idea.
In that case, the only thing is setting a login/password on the task. (Take care in case of password changes).
You might want to try running the command under a specific user account. It’s configurable in task property page.
Cheers,
Lawrence
Cheers,
Lawrence