Tired of Deleting the User directory?

Grexx

Space Marshal
Aug 29, 2016
6
14
2,175
RSI Handle
Grexxiggin
Hi everyone know I am not often here but here is my contribution.
Also I am not sure where this should go in the forums...so I trying here.
I started working on this tonight when watching Captain_Richard during these past few days for the various PTU builds and now the live. I understand that the controller directory in the USER folder is maybe the only directory that is needed as it holds our custom controller setup.
So here is my solution. Maybe powerscript next, either way fun little practice.
This is a batch file, just copy it into a text editor and save it as *.bat and you are good to go.
The file must be placed in the "Cloud Imperium Games" directory!

This little batch file will backup and delete in 2 way the User directory, and you can also choose to restore from the backup that is created if you made a mistake. I have been testing this and I think it works right.

Perhaps this will help others. :slight_smile:
Well see you in the verse.
batch file starts here:

@ECHO OFF
REM Created by Grexxiggin of TEST SQUADRON
REM alpha 1.0 next verion SOON! maybe.
REM This needs to be placed in the "Cloud Imperium Games" directory
:START
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@ECHO Choose (B) to Backup the User Directory and what is to be deleted from it
@ECHO Choose (R) to Restore a previous User directory backup
@ECHO Choose (E) to Exit
@ECHO:
Choice /N /C:BRE /M "Do you wish to (B)ackup, (R)estore, or (E)xit:"%1
if ERRORLEVEL == 3 GOTO LEAVEBAD
if ERRORLEVEL == 2 GOTO RESTOREUSER
if ERRORLEVEL == 1 GOTO BACKUPUSER

:RESTOREUSER
cls
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@ECHO Restore Selected
@ECHO:
Choice /M "Make Restore?"%1
if ERRORLEVEL == 2 GOTO NORESTORE
if ERRORLEVEL == 1 GOTO YESRESTORE
@ECHO:

:NORESTORE
cls
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@echo RESTORE not done
@ECHO:
echo Exiting Star Citizen User Folder Utility
@ECHO:
pause
GOTO LEAVEBAD

:YESRESTORE
@ECHO This will write over anything currently in Star Citizen USER directory
if EXIST "Star-Citizen-User-Backup" (
if not exist "\StarCitizen\Public\USER" mkdir StarCitizen\Public\USER
xcopy /Y /E /I /F Star-Citizen-User-Backup StarCitizen\Public\USER\
cls
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@ECHO USER Directory Files Restored
@ECHO:
pause
GOTO LEAVEGOOD
)
@ECHO Backup Directory "Star-Citizen-User-Backup" not found
pause
cls
GOTO START



:BACKUPUSER
cls
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@Echo The backup of User directory is: Star-Citizen-User-Backup in the StarCitizen Directory
@ECHO OFF
@ECHO:
REM Backup the User dirtory
Choice /M "Make Backup? ****Warning old BACKUP will be overwritten!****"%1
if ERRORLEVEL == 2 GOTO NO
if ERRORLEVEL == 1 GOTO YES
:YES
xcopy /E /Y StarCitizen\Public\USER\*.* Star-Citizen-User-Backup\
cls
REM *******************************
GOTO DELETECHOICE
:NO
echo backup not done
echo Exiting Star Citizen User Folder Utility
pause
GOTO LEAVEBAD

REM *******************************
:smile:ELETECHOICE
rem okay the formating has confused things...where the smile face is it is a colon and a uppercase D
cls
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
Choice /C:AE /M "Choose to delete (A)ll of the USER directory or (E)xclude the Controls subdirctory"%1
if ERRORLEVEL == 2 GOTO DELETE2
if ERRORLEVEL == 1 GOTO DELETE1

:smile:ELETE1
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@ECHO OFF
REM Deletes all of the USER Directory
rmdir /S /Q StarCitizen\Public\USER
GOTO LEAVEGOOD

:smile:ELETE2
@ECHO OFF
REM deletion of USER Files and Sub directories, but not the Controls Directory
rmdir /S /Q StarCitizen\Public\USER\Profiles
rmdir /S /Q StarCitizen\Public\USER\Shaders
rmdir /S /Q StarCitizen\Public\USER\StatsLogs
del /S /Q StarCitizen\Public\USER\game.cfg
GOTO LEAVEGOOD

:LEAVEGOOD
cls
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@ECHO Operation is Finished Leaving Utility
@ECHO:
@ECHO See you in the Verse!
@ECHO:
pause
exit

:LEAVEBAD
cls
@ECHO:
@Echo *** Star Citizen User Folder Utility ***
@ECHO:
@ECHO No Action Taken Leaving Utility
@ECHO:
@ECHO See you in the Verse!
@ECHO:
pause
exit
 
Last edited:

BUTUZ

Space Marshal
Donor
Apr 8, 2016
3,433
11,513
2,850
RSI Handle
BUTUZ
I've never deleted the user directory.
 
  • Like
Reactions: Mich Angel
Forgot your password?