Bonjour,
J'ai un petit soucis de planification de tache.
Mon programme créer une tache planifiée dans windows, via la Task Scheduler Library (http://www.codeproject.com/KB/cs/tsnewlib.aspx).
Mon soucis c'est que j'ai besoin de lancer cette tache dans un autre compte et ne pas être logge. J'ai décoché l'option : "run only if logged on" et indiqué le compte et le password ou je veux qu'elle s'exécute.
La tache se lance correctement mais pas l'application j'ai cette erreur :
Si je lancer l'application via le planificateur sur mon compte cela fonctionne sans soucis .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 Unhandled Exception: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at AGSUploader.LoadingWorker.DoWork() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
Mon soucis c'est que j'ai bien des forms, crée en .NET qui se lance et qui télécharge/upload des fichiers.
Comment faire ?
J'ai vu et testé la commande AT, cela marche avec AT /interactive mais les options sont trop limitées (au niveau des répétitions des jours, des semaines ...) et je préférerais utiliser la librairie comme je le fais, tout fonctionne correctement !
Merci
Partager