Directory Not Found en executant une application depuis le Task Scheduller
Bonjour
Je suis en train de me casser la tete sur un truc de fou
J'ai ecris une petite application console qui doit s'executer sur un serveur a fin de copier des fichiers
Lorsque j'execute l'application manuellement : Tout va bien
Mais lorsque je l'execute depuis le Task Scheduller elle ne trouve pas les répertoires concerné et le scheduller donne un code de retour E0434F4D
Pour illustrer voici le code qui détecte l'erreur (ensuite les messages selon le mode manuel ou le mode Scheduller)
Un génie aurais-t-il une idée ?
Merci de votre aide
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| if (!Directory.Exists(PhotoRefPath))
{
C_Log.log(string.Format("{0}: Directory do not exists", PhotoRefPath));
try
{
C_Log.log("Try to Create "+ PhotoRefPath);
Directory.CreateDirectory(PhotoRefPath);
}
catch(Exception e)
{
C_Log.log(e.Message);
return;
}
}
C_Log.log(string.Format("{0}: Directory EXISTS", PhotoRefPath));
if (!Directory.Exists(ArchiveRefPath))
{
Directory.CreateDirectory(ArchiveRefPath);
}
C_Log.log("Try Photo C"); |
Citation:
Envoyé par Mode Scheduller
2015-06-28 10:53 03.8427 **** Start Process
2015-06-28 10:53 03.8427 No Scan Data to Process
2015-06-28 10:53 03.8427 r:/Photo/_PhotoRef: Directory do not exists
2015-06-28 10:53 03.8427 Try to Create r:/Photo/_PhotoRef
2015-06-28 10:53 03.9051 Could not find a part of the path 'r:/Photo/_PhotoRef'.
Citation:
Envoyé par Mode Manuel
2015-06-28 10:52 35.0915 **** Start Process
2015-06-28 10:52 35.0915 No Scan Data to Process
2015-06-28 10:52 35.1071 r:/Photo/_PhotoRef: Directory EXISTS
2015-06-28 10:52 35.1071 Try Photo C
2015-06-28 10:52 35.1071 No PhotoRef to Process