Asked 1 year, 3 months ago. Active 23 days ago. Viewed 3k times. Improve this question. Kurt Raschke 2 2 bronze badges. You can have the same result using powershell, is this an option for you? Powershell could be a plan B, some powershell scripting is blocked because security policy. Why are people still cobbling together batch scripts? Powershell has been around for 13 years now, and at least two thirds of that time it's been mature enough to be used for everyday work.
It's so much more powerful and easy to use than batch. I guess the question is not related about if batch of powershell is good.
I would love to use powershell — DefToneR. Add a comment. Active Oldest Votes. Improve this answer. Greg Askew Greg Askew Thanks for the reply! Deftoner: yes, that is odd, it must have been stripped out when I pasted it in. Thanks again! Phil Lawson Phil Lawson 1 1 1 bronze badge. That is one solution. I can't move the folder as it is the default installation path of a proprietary software. I will use this solution for now until I can find a quicker way setting permissions.
JarirS Great, you should be able to set the variable and then pass that as an argument to a routine in the same batch script as well then with that routine having the RUNAS logic keeping the identity per the RUNAS command is run. That should work to keep it all contained to the same one script -- I edited my answer to show you an example.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Related 2. Asked 6 years ago views. Add the argument for verbose logging to your command line. The resulting log will tell you what's going wrong.
That will save you a bunch of faffing about, in order to get your command line sorted. Of course, you will already know that PSExec is part of the SysInternals suite of tools, since anyone even remotely connected with PCs will have this in their toolkit. And of course you may have noticed that the JRE runtime installs a bunch of registry entries into the user's HKCU registry which will not be accessible from a local system account.
Answer this question. Posted by:. Don't be a Stranger!
0コメント