Ox73
IS-IT--Management
- Nov 5, 2004
- 16
I have several scripts that do somewhat that but not quite I have the read all but I think I need some kind of IF statement that says look for these words...
1. logged on user profile because file will be in the user profile C:\Users\USERNAME\AppData\Local\LOGFOLDERHASMANYFILES
2. In this folder there will be multiple files I'm only after the latest file this is the one that will have the error
3. Search for the error "error keyword here"
4. Have a message found folder with problem do you want to delete it? folder... patch shown e.g.
5. After the key word a path of a folder (file really but I need that folder path to delete that folder)
System.IO.FileNotFoundException: error keyword here 'C:\Users\USERNAME\AppData\Local\SOMEAPPLICATIONFOLDER\SOMESUBFOLDER\3\IGNORESOMEXMLFILE.xml'.
So really the folder that needs to be deleted is called "3"
SO IN OTHERWORDS ONE FILE WILL HAVE THE MESSAGE THAT SHOWS THE FOLDER PATH AND THE OTHER IS DELETE THE ACTUAL FOLDER WITH PROBLEM.
1. logged on user profile because file will be in the user profile C:\Users\USERNAME\AppData\Local\LOGFOLDERHASMANYFILES
2. In this folder there will be multiple files I'm only after the latest file this is the one that will have the error
3. Search for the error "error keyword here"
4. Have a message found folder with problem do you want to delete it? folder... patch shown e.g.
5. After the key word a path of a folder (file really but I need that folder path to delete that folder)
System.IO.FileNotFoundException: error keyword here 'C:\Users\USERNAME\AppData\Local\SOMEAPPLICATIONFOLDER\SOMESUBFOLDER\3\IGNORESOMEXMLFILE.xml'.
So really the folder that needs to be deleted is called "3"
SO IN OTHERWORDS ONE FILE WILL HAVE THE MESSAGE THAT SHOWS THE FOLDER PATH AND THE OTHER IS DELETE THE ACTUAL FOLDER WITH PROBLEM.