Before I open my big mouth and say it is the default way a console app works in c# I wanted to get a few of you folks opinion.
Essentially, we have a c# console app the create a folder full of files from byte streams. Pretty simple. They now want to have it write directly to a shared drive that only a few people have read/write privilages.
I think that as long as they kick of the exe while logged in as as privelaged user it will copy to the share drive.
Unfortunately, they want this information without creating the folder and share first. sigh b/c that would have been too easy to just test the blasted thing.
To answer the question in the title of your question, yes, a C# console app runs under whatever account you run it as.
Note, you should be able to right click on the executable and click "run as" or "run as administrator" instead of actually logging on as another user.
I hope I'm not missing the point of your question.
By default, yes, it will run under the logged in user credentials (as would any other application).
Of course, if this is run as a scheduled task, uses the Process
class or the runas
command, one can specify a different user.
If you open task manager, you will see the process owner in the "User Name" collumn.
Any application run without specifying a specific user (Run as...) runs under default logged in user's context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With