Batch to wipe / default Win10

February 2, 2020 at 15:10:01
Specs: Windows 10
Were a small business without time to invest into an imaging solution or create one ourselves, plus we would like the transparency of a script instead of building and managing an image. The need is a script (in either powershell or batch) that we just run on the machine and walk away. I've finished all our needs via batch but this. I can execute systemreset -cleanpc but then that brings up a series of clicking and idle time. It really needs to be completely hands off. I also see a way to remotely wipe using powershell, but we don't have a machine to do this and manage the rest of the needs. I think it's making it more complicated than it needs to be. It took me about 15 minutes to get all our other needs down in batch (installing programs, setting the admin, configuring the default profile etc) but somehow (and factory defaulting would be best) we need to also remove any user installed applications, accounts, etc... or at the very least just everything but the applications. It needs to be clean of their stuff as possible. Is anyone aware of a batch or powershell script that will do something like this?

See More: Batch to wipe / default Win10

February 3, 2020 at 05:48:14
So if I get it right, you want some script that removes programs and Windows accounts, not by re-installing Windows 10 itself, but it has to be command line (no GUI) and no interruptions whatsoever ?

Report •

March 12, 2020 at 05:27:49
This sounds more complicated than a windows server running WDS/MDT.

It takes very little time and effort to set up a deployment server if you know what youre doing, and its easy to learn if you dont. Not to mention its much more userfriendly if someone else is going to edit this later, in my experience if its too complicated or not documented well i will just start all over rather than editing.

I use WDS and MDT to reinstall windows and software at work every day, and it does so without interaction, strongly recommend investing some time in a proper setup!


If you just want to delete a user and its files then you could do something like this:

@echo off

title Delete User Account


echo Delete a useraccount
echo Local account or Domain account?
echo [L] Local
echo [D] Domain
choice /c LD /n /m "Your choice? "

if %errorlevel%==1 goto:LocalAcc
if %errorlevel%==2 goto:DomainAcc


set /p accname=Type in the useraccount name here:

net user %accname% /delete

del /q /s C:\Users\%accname%


set /p accname=Type in the useraccount name here:

net user %accname% /delete /domain

del /q /s \\SERVER-NAME\Users\%accname%

message edited by Kilavila

Report •
Related Solutions

Ask Question