New
#11
You're trying to circumvent win security protocol. Batch file run from guest cmd & elevate guest to admin rights?
Don't believe that's possible!
How to open an elevated cmd using command line for Windows ...
#62 green check
You're trying to circumvent win security protocol. Batch file run from guest cmd & elevate guest to admin rights?
Don't believe that's possible!
How to open an elevated cmd using command line for Windows ...
#62 green check
Would opening PowerShell from within the batch file and performing the processes [then closing PowerShell] overcome the administrator restrictions?
I would assume that it doesn't!
No joy? I'd thought you'd have this up and running by now! I did a bit more homework on the two commands, and I tried this on a folder called Demo, and it seems to work perfectly.
This returns success on mine, so I'd assume it would also work on c:\windows\logs\cbs on your computer. Assume user1 has admin rights.Code:RUNAS /profile /user:user1 "iCACLS c:\users\user1\desktop\demo /deny user1:(OI)(CI)F" RUNAS /profile /user:user1 "iCACLS c:\users\user1\desktop\demo /grant user1:(OI)(CI)F"
I think @Snick is correct, you cannot run an elevated command prompt from a batch file. This example does not attempt to break that restriction.
Last edited by iko22; 18 Apr 2019 at 04:15. Reason: formatting text
Hi iko22,
I have had limited time to spend on this for the last couple of days, but I will get around to it this afternoon, hopefully!
That was what I thought, but I wondered if there was a clever workaround, obviously not, which makes sense because it is to keep the integrity of the system secure!
Thanks again.
Hello Paul
THe syntax for the REN statement says you are trying to RENAME the entire folder. DO you not want to rename the CBS.log within the CBS folder?
Well, my reference to #62 green was the response number that was marked with a green check-mark.
It's not there anymore. Many other responses not there either, must be admin vetting.
The gist of the response was that you can't elevate from guest to admin from within the guest process. Don't recall who claimed to be the respondent.