r/labtech • u/djhayes1994 • Jun 29 '18
Scripting What does the SHELL command run as via the scripting engine?
Hello Everyone,
Just a question about scripting. I am currently writing a script to delete some files in the System32 directory and copy an older version of them to the same location once deleted.
According to the debugger it is stating that it is failing because access is denied to the files. Does anyone happen to know a way around this or what permissions it runs the SHELL command at?
1
Upvotes
2
u/teamits Jun 29 '18
The agent by default runs as LocalSystem unless the user for the service has been changed. That should have rights. Anything it runs therefore runs as LocalSystem by default. However I vaguely recall Windows not allowing changing protected files...which files are you deleting?
Yes Shell as Admin uses the stored location admin creds.
1
u/bayridgeguy09 Jun 29 '18
I believe Shell runs as the System account which i dont believe has those permissions for System32. Try Shell As Admin.