Local Service to monitor a folder on desktop
-
I am currently working on monitoring the folder on desktop. When the hex data files are dragged into the "Monitored" folder, it would automatically start to analyze the hex files and create the interpreted files into other folder. I have created the Local Service process "Interpreter Service". The thing is that when I started the service then it abruptly stopped running. Upon checking Event Viewer, it reported the error: Service cannot be started. System.ArgumentException: The directory name C:\Users\RBWorkstation\Desktop\Monitored Folder\ is invalid. at System.IO.FileSystemWatcher.set_Path(String value) at InterpreterService.UM_InterpreterService.OnStart(String[] args) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state) The folder is right on my desktop! So anyone have any suggestion on how to fix this so this service can find the folder? Thanks! ~ Ron Boucher
-
I am currently working on monitoring the folder on desktop. When the hex data files are dragged into the "Monitored" folder, it would automatically start to analyze the hex files and create the interpreted files into other folder. I have created the Local Service process "Interpreter Service". The thing is that when I started the service then it abruptly stopped running. Upon checking Event Viewer, it reported the error: Service cannot be started. System.ArgumentException: The directory name C:\Users\RBWorkstation\Desktop\Monitored Folder\ is invalid. at System.IO.FileSystemWatcher.set_Path(String value) at InterpreterService.UM_InterpreterService.OnStart(String[] args) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state) The folder is right on my desktop! So anyone have any suggestion on how to fix this so this service can find the folder? Thanks! ~ Ron Boucher
What account is your service running as? Does it have access to the folders in your profile?
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
What account is your service running as? Does it have access to the folders in your profile?
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Yes, but what account is the service running as? When you created the service installer, you selected an account for the service to run as. That account needs to have sufficient permissions to access the folder it's trying to monitor.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Yes, but what account is the service running as? When you created the service installer, you selected an account for the service to run as. That account needs to have sufficient permissions to access the folder it's trying to monitor.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
There are multiple accounts on your machine. Regardless of you logging in as admin, normal services do NOT run with those rights. Open the services, find yours, right-click, and check which user. Chances are it's "SYSTEM", wich does not have the same rights as your admin-account. The reason for that is that the service runs before someone (like you as admin) can loging and prove who he/she is - the service will already be started with the credentials provided.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
Ah, it wasn't clear that that was the account; I though you were just describing the type of service. :doh: The Local Service account "has minimum privileges on the local computer and presents anonymous credentials on the network"[^]. It most likely doesn't have permission to access a folder within your profile. Try changing it to run as Local System, or as your user account.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I am currently working on monitoring the folder on desktop. When the hex data files are dragged into the "Monitored" folder, it would automatically start to analyze the hex files and create the interpreted files into other folder. I have created the Local Service process "Interpreter Service". The thing is that when I started the service then it abruptly stopped running. Upon checking Event Viewer, it reported the error: Service cannot be started. System.ArgumentException: The directory name C:\Users\RBWorkstation\Desktop\Monitored Folder\ is invalid. at System.IO.FileSystemWatcher.set_Path(String value) at InterpreterService.UM_InterpreterService.OnStart(String[] args) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state) The folder is right on my desktop! So anyone have any suggestion on how to fix this so this service can find the folder? Thanks! ~ Ron Boucher
Try running the service under Administrative account