Ability to start WinBatch script as one user, then change during execution

Started by krasdude, November 21, 2019, 02:56:09 PM

Previous topic - Next topic

krasdude

Hello all

Is there way within WinBatch.  I have several scripts that accesses \\machine\C$ and do some things we need.  Is there a way to start the script as normal user account so it can read host file, start Excel and such from OneDrive, then right when it's time to access the code to access C$, switch to another AD account that has permissions to access C$?

I tried RUNAS (Shift-right click) but keep getting Windows Access error.  I'd prefer not logging into laptop as other AD account as that has other issues.  Just curious if anyone has any thoughts

Thanks all