Author Topic: Ability to start WinBatch script as one user, then change during execution  (Read 51 times)

krasdude

  • Newbie
  • *
  • Posts: 18
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

krasdude

  • Newbie
  • *
  • Posts: 18
Re: Ability to start WinBatch script as one user, then change during execution
« Reply #1 on: November 21, 2019, 03:13:27 pm »
Sorry to bother, I found my answer.  thanks.