Hi,
I'm new of this thread and I do not know if this is the right section of the forum. I'm under windows 10 1803 64 bit.
I have two scripts (.cmd and .ps1) which execute the same operation. The scripts work well if I run them from cmd or powershell while they do not work if I use schtasks.
In particular, the job is created correctly and it starts after login, but the scripts fail to execute. The script executes a program in a new windows, but it is closed immediately and it is not possible to catch the error.
I tried to redirect the output of cmd in order to capture the error, but it does not work.
Do you have any suggestion?
I'm new of this thread and I do not know if this is the right section of the forum. I'm under windows 10 1803 64 bit.
I have two scripts (.cmd and .ps1) which execute the same operation. The scripts work well if I run them from cmd or powershell while they do not work if I use schtasks.
In particular, the job is created correctly and it starts after login, but the scripts fail to execute. The script executes a program in a new windows, but it is closed immediately and it is not possible to catch the error.
I tried to redirect the output of cmd in order to capture the error, but it does not work.
Code:
start cmd /c program arg1 arg2 2^> out_err.txt
Last edited: