Universal Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tuvix
Posts: 2
Joined: 08 Jun 2022 00:16

Universal Batch

#1 Post by tuvix » 08 Jun 2022 00:22

Hey guys, I am trying to create a universal batch file so I won't have to keep changing the user profile. Replace "Username" but it needs to be universal.

Here is what I have

@echo off
set ChromeDir=C:\Users\Username\AppData\Local\Google\Chrome\User Data
del /q /s /f "%ChromeDir%"
rd /s /q "%ChromeDir%"

@echo off
set EdgeDir=c:\users\Username\appdata\local\microsoft\edge\user data
del /q /s /f "%EdgeDir%"
rd /s /q "%EdgeDir%"

@echo off
set VivaldiDir=c:\users\Username\appdata\local\Vivaldi\user data
del /q /s /f "%VivaldiDir%"
rd /s /q "%VivaldiDir%"

@echo off
set DataDir=C:\Users\Username\AppData\Local\Mozilla\Firefox\Profiles
del /q /s /f "%DataDir%"
rd /s /q "%DataDir%"
for /d %%x in (C:\Users\Username\AppData\Roaming\Mozilla\Firefox\Profiles\*) do del /q /s /f %%x\*sqlite

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Universal Batch

#2 Post by aGerman » 08 Jun 2022 10:57

Run SET in a cmd window and see what variables are already predefined.
Besides of %username% which obviously contains the user name, you'll find %localappdata% representing C:\Users\[Username]\AppData\Local, and %appdata% representing C:\Users\[Username]\AppData\Roaming.

Steffen

Post Reply