Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

bat files and ps1 script

$
0
0

I am having a tough time trying to get a bat file to work that will open a elevated command prompt and run a ps1 script. The ps1 script then should add a local user to the device and do various items. I have searched the internet and found a few sites and I can get the bat file to open the the elevated PowerShell script but the window closes so fast I don't know why it isn't performing the script. I have copied and pasted the script into PowerShell and received my desired results. 

 

I found information for the script here

http://stackoverflow.com/questions/15167069/powershell-create-local-user-account

and the bat files here

http://www.howtogeek.com/204088/how-to-use-a-batch-file-to-make-powershell-scripts-easier-to-run/

 

Any help is greatly appreciated - my coworkers aren't able to take several steps to run a script so it would be nice to get things to a point where they run one file and can set the local user account for individual devices. 


Viewing all articles
Browse latest Browse all 6937

Trending Articles