This PowerShell script automates the following tasks:
- Optionally resets Windows to factory settings.
- Installs all
.exeinstaller files found in the same folder as the script. - Creates a new local administrator account (with optional username and password).
- Copies files from a
systemfolder (if present) to the new user's profile folders. - Logs all actions to a
setup_log.txtfile in the script's folder.
-
Prompt for Windows Reset:
The script asks if you want to reset the PC. If you choose "Y", it will initiate a Windows reset (removing all apps and settings). If you choose "N", it skips this step. -
Install
.exeFiles:
All.exefiles in the same directory as the script are installed silently (if the installers support silent mode). -
Create Local Admin Account:
You are prompted for a username (default:default) and password (leave blank for no password). The script creates this user and adds it to the Administrators group. -
Copy User Files from
systemFolder:
If a folder namedsystemexists in the script's directory, any subfolders (such asDesktop,Documents,Videos, etc.) and their contents will be copied into the corresponding folders in the new user's profile. -
Logging:
All actions and results are logged tosetup_log.txtin the script's folder. -
Summary:
At the end, a summary of actions is displayed.
-
Preparation:
- Place the script (
reset_and_setup.ps1), all desired.exeinstaller files, and (optionally) asystemfolder with user files in the same folder. - Open PowerShell as Administrator.
- Place the script (
-
Execution:
- Navigate to the script's folder in PowerShell.
- Run the script:
.\reset_and_setup.ps1
- Follow the prompts to reset Windows (optional), install applications, create a local admin account, and (if present) copy user files.
-
Run as Administrator:
The script must be run with administrative privileges. -
Windows Reset:
If you choose to reset, all apps and settings will be removed. Data loss may occur. -
Silent Installers:
The script attempts to install.exefiles silently. If an installer does not support silent mode, it may not install correctly. -
Copying User Files:
If asystemfolder is present, its subfolders and files will be copied to the new user's profile. Existing files may be overwritten. -
Security:
Creating an admin account with no password is insecure. Use a strong password whenever possible. -
Log File:
Checksetup_log.txtfor a detailed log of all actions.
Use this script at your own risk. Always back up important data before running system reset operations.