Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Adminify


  • Please log in to reply
22 replies to this topic

#1 tellus

tellus

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 21 August 2013 - 02:49 PM

I've written a batch tool (adminify) that makes changes to the GUI and UI in windows xp through 8.  The changes I speak of are actually the first steps in all malware removal - the ones that disable all the post-windows2000 gobbledygook that hide files, extensions, and adds step to or break down the process (like UAC).  I also disable Themes because I don't like it.
 
It seems like something that is sorely missing from the IT toolkit - it takes 15 minutes to check all those boxes manually and 15 minutes to set them back.

Here's a list of what it does (and un-does):

      *BACKS UP areas of the registry to be manipulated into backups\*.reg
      *DISABLE User Account Control - Reboot Required!
      *Make Hidden, SuperHidden, Protected Operating System Files, and
       File Extensions visible.
      *Display full path in address bar and title bar
      *STOP and DISABLE the Themes Service
      *STOPs and RESTARTS the explorer process

*DISCLAIMER: This program will modify the registry of the computer you run
it on, automatically if you use arguments.  Use with caution and create a
restore point before continuing.  Of course, you can edit the .reg files in
any way you like, but the author recommends that before you do so you
understand the rationale of the order of operations used by the program
(Full Backup of Keys/Values, Modify Keys/Values, Restore Default Keys/Values,
Restore User Keys/Values.)*

 

Anyway, if anyone wants to try it out and tell me what you think I've been testing it and haven't run into any problems!  Just PM me.  I'll send you a zip with instructions.

 



BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:08:59 AM

Posted 21 August 2013 - 08:27 PM

How does your registry backup work? If they are .reg files, note that .reg files are useless as a registry backup, because they don't track deletes. If an application adds a new key or value that causes the problem, merging the .reg file will not remove the value.

If you want to registry backup, you should use tools designed for that task, such as ERUNT or System Restore.

Why do you want to stop and restart explorer?

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 22 August 2013 - 08:31 AM

Hey, Billy!

 

I use ERUNT for registry backups, and I was really glad to have found that tool (I found it here).  The program I'm writing makes no attempt to remove malware entries or backup and restore the entire registry, it just backs up certain areas of the registry, modifies/adds some keys and values, and then re-adjusts things back to the way the user had it originally.  The backups it makes and restores might include some entries subsequently removed by malware tools, etc. but more authoring could probably be done to ensure that they're removed again. 

 

Why do you want to stop and restart explorer?

 

Explorer is stopped and restarted because its the easiest way I know to implement changes to the UI without rebooting.

 

I don't want to break forum rules by posting code here - and I was going to attach the file but I don't see an attach option so I'd imagine it's not allowed in this forum, but I'll PM you the .zip so you can try it out.  It must be "run as administrator".

 

For everyone else who's curious, here's a better description of what the program does and the text of some of the .reg files.

 

Step 1: Backup

Back up these keys to separate registry files

HKCU_CP_desktop-backup.reg
HKCU_explorer_advanced-backup.reg
HKCU_explorer_cabinetstate-backup.reg
HKLM_policies_system-backup.reg
HKLM_services_themes-backup.reg

 

Step 2: Adminify

Apply the values in adminify_tweaked_values.reg

Stop the Themes service

Stop and Start Explorer to implement most changes immediately

Warn to reboot to disable UAC

 

Step 3: De-Adminify (Return things to the way they were before we started)

Import default values using adminify_default_values.reg

Import backed-up user values from these files:

HKCU_CP_desktop-backup.reg
HKCU_explorer_advanced-backup.reg
HKCU_explorer_cabinetstate-backup.reg
HKLM_policies_system-backup.reg
HKLM_services_themes-backup.reg

Start the Themes service

Stop and Start Explorer to implement most changes immediately

Warn to reboot to return UAC to desired level

 

adminify_tweaked_values.reg contains this:

 

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't)
"Hidden"=dword:00000001            ;Show hidden files and folders (1=Do, 2=Don't)
"HideFileExt"=dword:00000000        ;Hide file extensions (1=Enabled, 0=Disabled)
"DontPrettyPath"=dword:00000001        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True)
"ShowSuperHidden"=dword:00000001    ;I'm not really sure (1=Enabled, 0=Disabled)
"IntelliMenus"=dword:00000000        ;Menus (such as the start menu) are personalized (1=True, 0=False)

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
"FullPath"=dword:00000001        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled)
"FullPathAddress"=dword:00000001    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled)

[HKEY_CURRENT_USER\Control Panel\Desktop]
"MenuShowDelay"="100"            ;Shorten menu delay (Default value "400")

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system]
"EnableLUA"=dword:00000000        ;Enable UAC (1=Enabled, 0=Disabled)

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes]
"Start"=dword:00000004            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled)

 

adminify_default_values.reg contains this:

 

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't)
"Hidden"=dword:00000002            ;Show hidden files and folders (1=Do, 2=Don't)
"HideFileExt"=dword:00000001        ;Hide file extensions (1=Enabled, 0=Disabled)
"DontPrettyPath"=dword:00000000        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True)
"ShowSuperHidden"=dword:00000000    ;I'm not really sure (1=Enabled, 0=Disabled)
"IntelliMenus"=dword:00000001        ;Menus (such as the start menu) are personalized (1=True, 0=False)

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
"FullPath"=dword:00000000        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled)
"FullPathAddress"=dword:00000000    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled)

[HKEY_CURRENT_USER\Control Panel\Desktop]
"MenuShowDelay"="400"            ;Shorten menu delay (Default value "400")

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system]
"EnableLUA"=dword:00000001        ;Enable UAC (1=Enabled, 0=Disabled)

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes]
"Start"=dword:00000002            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled)



#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:59 AM

Posted 22 August 2013 - 10:18 AM

You can post your code. There are BB tags to enclose your code snippets so that the snip retains formatting.



#5 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 22 August 2013 - 12:58 PM

Ah, I see, thanks for the info!  Probably should have lurked a bit more to learn the nuances...

 

All the files you create from the code below should go in the same folder, then run adminify.bat as an administrator.  I've not tested it on windows 8, but it worked well on windows 7.  Backups will be placed in a folder called 'backups' in the folder you run the program from.

 

Paste the code below into a file named adminify.bat.  The program has a hidden menu you don't really need - anything with a c_ in front of it is a part of a common structure shared by all my batch files and can be ignored.

 

@ECHO OFF
:c_set
COLOR 2
SET spacer=*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
:p_set
SET p_path=.
SET p_name=adminify
SET p_type=.bat
set p_tools=.
@title %p_name%
:ifequal
IF '%1' == '' GOTO p_about
IF '%1' == 'no_disclaimer' GOTO p_mainmenu
IF '%1' == 'go' GOTO backup_user_settings
IF '%1' == 'un' GOTO restore_create_settings
ECHO %spacer%
ECHO.
ECHO Running %p_name%%p_type% with %1 argument
ECHO.
GOTO %1
GOTO p_mainmenu
:p_about
@title %p_name% - About adminify
ECHO The purpose of this program is to make a computer more fixable by tweaking
ECHO the windows GUI, while providing a way to get things back to normal after
ECHO the fixes have been performed...
ECHO.
ECHO Here's a list of what it does (and un-does):
ECHO *DISABLE User Account Control - Reboot Required!
ECHO *Make Hidden, SuperHidden, Protected Operating System Files, and
ECHO File Extensions visible.
ECHO *Display full path in address bar and title bar
ECHO *STOP and DISABLE the Themes Service
ECHO *STOPs and RESTARTS the explorer process
ECHO.
ECHO *DISCLAIMER: This program will modify the registry of the computer you run
ECHO it on, automatically if you use arguments. Use with caution and create a
ECHO restore point before continuing. Of course, you can edit the .reg files in
ECHO any way you like, but the author recommends that before you do so you
ECHO understand the rationale of the order of operations used by the program
ECHO (Full Backup of Keys/Values, Modify Keys/Values, Restore Default Keys/Values,
ECHO Restore User Keys/Values.)*
ECHO.
@pause
GOTO p_mainmenu
:p_mainmenu
CLS
@Title %p_name% - Main Menu
SET substatus=p_chosen
ECHO.
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO No backup exists! Run option 1 before adminifying or restoring settings!
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO.
ECHO Main Menu:
ECHO 1. Backup settings to be changed (DO THIS FIRST!)
ECHO 2. Adminify (see help for description)
ECHO 3. De-adminify (set adminified values to default,
ECHO then re-apply backed-up user settings)
ECHO 4. Open program folder to manually run .reg files
ECHO 5. Open services.msc to manually disable services
ECHO 6. Open the User Account Control Settings dialog
:ECHO 7. Not Implemented
REM Remove the colon from the line below to enable the common menu (for batch file tweaking)
:GOTO c_menu
GOTO c_choice
:c_menu
ECHO Common:
ECHO r. Reload Program
ECHO e. Edit/View Program
ECHO b. BackUp then Edit Program
ECHO bb. Backup .bat files in %p_path%
ECHO f. Open Program Folder
ECHO m. Main Menu
ECHO x. Exit the Program
ECHO.
:c_choice
SET /p x=Pick:
ECHO.
:c_chosen
@Title %p_name%
IF '%x%' == '' GOTO c_nochoice
IF '%x%' == 'r' GOTO c_reload
IF '%x%' == 'e' GOTO c_edit
IF '%x%' == 'b' GOTO c_backup
IF '%x%' == 'bb' GOTO c_batchbackup
IF '%x%' == 'f' GOTO c_folder_open
IF '%x%' == 'x' GOTO end
GOTO %substatus%
:c_nochoice
ECHO.
ECHO That is not a valid selection.
ECHO.
GOTO p_mainmenu
:c_reload
start %p_path%\%p_name%%p_type%
GOTO end
:c_backup
copy %p_path%\%p_name%%p_type% "%p_path%\%p_name%_pre-%date:~4,2%-%date:~7,2%-%date:~10,4%_H%time:~0,2%_M%time:~3,2%%p_type%"
GOTO c_edit
:c_batchbackup
IF NOT EXIST %p_path%\*%p_type% GOTO p_mainmenu
ECHO Moving %p_type% files in %p_path% to
ECHO a destination. First, choose a destination...
ECHO ex: x:, dev, "folder name", etc.
SET /p dest=Pick:
%p_tools%\robocopy %p_path% %dest% *-pre_*%p_type% /xf /mov /zb
%p_tools%\robocopy %p_path% %dest% *%p_type% /zb
ECHO.
GOTO p_mainmenu
:c_edit
notepad %p_path%\%p_name%%p_type%
GOTO c_reload
:c_folder_open
start explorer %p_path%
GOTO c_reload
IF %substatus%' IS 'null' GOTO p_mainmenu
:p_chosen
@Title %p_name%
IF '%x%' == '1' GOTO backup_user_settings
IF '%x%' == '2' GOTO set_desired_values
IF '%x%' == '3' GOTO restore_create_settings
IF '%x%' == '4' START explorer %p_path%
IF '%x%' == '5' START services.msc
IF '%x%' == '6' START %systemroot%\system32\UserAccountControlSettings.exe
:IF '%x%' == '7'
GOTO p_mainmenu
:backup_user_settings
CLS
@title %p_name% - Backing up User Settings
IF NOT EXIST %p_path%\backups md %p_path%\backups
IF EXIST "%p_path%\backups\*-backup.reg" ren "%p_path%\backups\*-backup.reg" "*-backup_pre-%date:~4,2%-%date:~7,2%-%date:~10,4%_H%time:~0,2%_M%time:~3,2%.reg"
ECHO Backing up current user/computer registry keys/subkeys/values for all
ECHO areas of the registry to be modified
ECHO.
REGEDIT /E backups\HKCU_explorer_advanced-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
REGEDIT /E backups\HKCU_explorer_cabinetstate-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState"
REGEDIT /E backups\HKCU_CP_desktop-backup.reg "HKEY_CURRENT_USER\Control Panel\Desktop"
REGEDIT /E backups\HKLM_policies_system-backup.reg "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system"
REGEDIT /E backups\HKLM_services_themes-backup.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes"
ECHO %spacer%
ECHO.
ECHO The files listed below are the backups of the registry keys/values that
ECHO will be modified. If there is nothing listed below, do not continue!
ECHO.
ECHO %spacer%
ECHO.
dir /b backups\*-backup*.reg
ECHO.
ECHO %spacer%
@pause
IF '%1' == 'go' GOTO set_desired_values
GOTO p_mainmenu
:set_desired_values
CLS
@title %p_name% - adminifying
ECHO adminifying (Importing desired values for registry keys/subkeys we backed
ECHO up previously.)
ECHO.
REGEDIT /S adminify_tweaked_values.reg
:SET __COMPAT_LAYER=WINXPSP3
ECHO Stopping the Themes service...
ECHO.
sc stop Themes
GOTO restart_explorer
:restore_create_settings
IF NOT EXIST %p_path%\backups\*-backup.reg GOTO p_mainmenu
:import_default_values
CLS
@title %p_name% - Reversing adminification step 1 (Importing Default Values)
ECHO Importing default values for previously imported values that may have not
ECHO existed in the registry before we started...
REGEDIT /S adminify_default_values.reg
ECHO.
GOTO restore_user_settings
:restore_user_settings
CLS
@title %p_name% - Reversing adminification step 2 (Importing User Values)
ECHO Restoring current user/computer registry keys/subkeys/values we backed up
ECHO before adminifying...
ECHO.
REGEDIT /S backups\HKCU_explorer_advanced-backup.reg
REGEDIT /S backups\HKCU_explorer_cabinetstate-backup.reg
REGEDIT /S backups\HKCU_CP_desktop-backup.reg
REGEDIT /S backups\HKLM_EnableLUA-backup.reg
REGEDIT /S backups\HKLM_services_themes-backup.reg
ECHO Starting the Themes service (a reboot may be required)...
ECHO.
sc start Themes
ECHO.
GOTO restart_explorer
:restart_explorer
ECHO Stopping Explorer process...
ECHO.
taskkill /f /im explorer.exe
ECHO.
ECHO Wait 3 seconds...
ping -n 3 127.0.0.1 > nul
ECHO.
ECHO Starting Explorer process...
ECHO.
START %systemroot%\explorer
ECHO.
GOTO reboot_notification
:reboot_notification
ECHO %spacer%
ECHO A Logoff/Logon or Reboot is required to impose changes to User Account
ECHO Control settings and/or restart the Themes service in some cases...
ECHO %spacer%
ECHO.
GOTO done
:done
IF '%1' == 'go' ECHO adminification complete.
IF '%1' == 'un' ECHO adminification reversed.
ECHO.
@pause
IF '%1' == 'go' GOTO end
IF '%1' == 'un' GOTO end
CLS
GOTO p_mainmenu
:end
exit
 
Paste the code below into a file named adminify_default_values.reg
 
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"AlwaysShowMenus"=dword:00000001 ;Show menu in Windows Explorer (1=Do, 0=Don't)
"Hidden"=dword:00000002 ;Show hidden files and folders (1=Do, 2=Don't)
"HideFileExt"=dword:00000001 ;Hide file extensions (1=Enabled, 0=Disabled)
"DontPrettyPath"=dword:00000000 ;Files/directories in all caps displayed as mixed-case (1=False, 0=True)
"ShowSuperHidden"=dword:00000000 ;I'm not really sure (1=Enabled, 0=Disabled)
"IntelliMenus"=dword:00000001 ;Menus (such as the start menu) are personalized (1=True, 0=False)

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
"FullPath"=dword:00000000 ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled)
"FullPathAddress"=dword:00000000 ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled)

[HKEY_CURRENT_USER\Control Panel\Desktop]
"MenuShowDelay"="400" ;Shorten menu delay (Default value "400")

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system]
"EnableLUA"=dword:00000001 ;Enable UAC (1=Enabled, 0=Disabled)

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes]
"Start"=dword:00000002 ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled)
 
Paste the code below into a file named adminify_tweaked_values.reg

 

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"AlwaysShowMenus"=dword:00000001 ;Show menu in Windows Explorer (1=Do, 0=Don't)
"Hidden"=dword:00000001 ;Show hidden files and folders (1=Do, 2=Don't)
"HideFileExt"=dword:00000000 ;Hide file extensions (1=Enabled, 0=Disabled)
"DontPrettyPath"=dword:00000001 ;Files/directories in all caps displayed as mixed-case (1=False, 0=True)
"ShowSuperHidden"=dword:00000001 ;I'm not really sure (1=Enabled, 0=Disabled)
"IntelliMenus"=dword:00000000 ;Menus (such as the start menu) are personalized (1=True, 0=False)

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
"FullPath"=dword:00000001 ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled)
"FullPathAddress"=dword:00000001 ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled)

[HKEY_CURRENT_USER\Control Panel\Desktop]
"MenuShowDelay"="100" ;Shorten menu delay (Default value "400")

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system]
"EnableLUA"=dword:00000000 ;Enable UAC (1=Enabled, 0=Disabled)

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes]
"Start"=dword:00000004 ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled)


#6 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 24 August 2013 - 11:39 AM

Okay, I've 2.0ed the idea.  Now you only need to run one batch file to run the commands needed to back up affected areas of the registry and create the .reg files needed to alter the UI.  I also changed the menus.

 

The next step is figuring out how to make the program automatically create shortcuts with "run as administrator" privileges on the desktop - I think I can reverse engineer combofix and see how he does it to figure that out - I already know how to make shortcuts from cmd.

 

Don't forget to run as administrator.  This is untested on anything above XP, but I haven't changed anything about how it works, really, just changed menus, etc.

 

I appreciate any input, and hope this will be useful to you guys in some way.

 

Paste the code below into a file named adminify.bat.  Run it, follow the instructions, and let me know how it goes!

 

@ECHO OFF
:c_set
COLOR 2
SET spacer=*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
:p_set
SET p_path=.
SET p_name=adminify
SET p_type=.bat
set p_tools=.
@title %p_name%
:ifequal
IF '%1' == '' GOTO p_mainmenu
IF '%1' == 'go' GOTO backup_user_settings
IF '%1' == 'un' GOTO restore_create_settings
GOTO p_mainmenu
:p_about
set step_name=About adminify
CLS
@title %p_name% - %step_name%
ECHO.
ECHO The purpose of adminify is to make a computer more fixable by tweaking
ECHO the windows GUI, while  providing a way to get things back to normal after
ECHO the fixes have been performed...
ECHO.
ECHO *DISCLAIMER: This program will modify the registry of the computer you run
ECHO it on, automatically if you use arguments.  Use with caution and create a
ECHO restore point before continuing.  Of course, you can edit the .reg files in
ECHO any way you like, but the author recommends that before you do so you
ECHO understand the rationale of the order of operations used by the program
ECHO (Full Backup of Keys/Values, Modify Keys/Values, Restore Default Keys/Values,
ECHO Restore User Keys/Values.)*
ECHO.
@pause
GOTO p_mainmenu
:p_mainmenu
CLS
@Title %p_name% - Main Menu
SET substatus=p_chosen
ECHO.
ECHO Welcome to adminify!
ECHO.
ECHO Press any key to view Program Explanation and Disclaimer.
ECHO.
ECHO Main Menu:
ECHO    1. Adminify
ECHO         *Backup registry settings to be changed to \backups
ECHO         *DISABLE User Account Control - Reboot Required!
ECHO         *Make Hidden, SuperHidden, Protected Operating System Files, and
ECHO          File Extensions visible.
ECHO         *Display full path in address bar and title bar
ECHO         *STOPs and DISABLEs the Themes Service
ECHO         *STOPs and RESTARTs the explorer process
ECHO    2. De-adminify
ECHO         *Set adminified values to default
ECHO         *Re-apply backed-up user settings
ECHO         *Move backed-up user settings into a dated folder in \backups
ECHO         *RESTART stopped services and/or prompt for reboot.
ECHO    3. Open program folder to manually run .reg files
ECHO         *Do this if for some reason you adminified multiple times
ECHO          and need to restore older .reg backups.
ECHO    4. Open services.msc to manually change settings for other services
ECHO    5. Open the User Account Control Settings dialog
:ECHO    6. Not Implemented
GOTO p_choice
:p_choice
SET x=
SET /p x=Pick:
ECHO.
:p_chosen
@Title %p_name%
IF '%x%' == '1' GOTO backup_user_settings
IF '%x%' == '2' GOTO restore_create_settings
IF '%x%' == '3' START explorer %p_path%
IF '%x%' == '4' START services.msc
IF '%x%' == '5' START %systemroot%\system32\UserAccountControlSettings.exe
:IF '%x%' == '6'
GOTO p_about
:make_files
:make_file1
set mf_name=adminify_tweaked_values.reg
ECHO Windows Registry Editor Version 5.00 > %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%
ECHO "Hidden"=dword:00000001            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%
ECHO "HideFileExt"=dword:00000000        ;Hide file extentions (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "DontPrettyPath"=dword:00000001        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%
ECHO "ShowSuperHidden"=dword:00000001    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "IntelliMenus"=dword:00000000        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%
ECHO "FullPath"=dword:00000001        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "FullPathAddress"=dword:00000001    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%
ECHO "MenuShowDelay"="100"            ;Shorten menu delay (Default value "400") >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%
ECHO "EnableLUA"=dword:00000000        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%
ECHO "Start"=dword:00000004            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%
GOTO make_file2
:make_file2
set mf_name=adminify_default_values.reg
ECHO Windows Registry Editor Version 5.00 > %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%
ECHO "Hidden"=dword:00000002            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%
ECHO "HideFileExt"=dword:00000001        ;Hide file extensions (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "DontPrettyPath"=dword:00000000        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%
ECHO "ShowSuperHidden"=dword:00000000    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "IntelliMenus"=dword:00000001        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%
ECHO "FullPath"=dword:00000000        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "FullPathAddress"=dword:00000000    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%
ECHO "MenuShowDelay"="400"            ;Shorten menu delay (Default value "400") >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%
ECHO "EnableLUA"=dword:00000001        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%
ECHO "Start"=dword:00000002            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%
GOTO set_desired_values
:make_file3
REM Create code to make .lnk file to adminify.bat on desktop and assign administrator rights to it.
GOTO p_chosen
:backup_user_settings
set step_name=Backing up User Settings
CLS
@title %p_name% - %step_name%
IF NOT EXIST %p_path%\backups md %p_path%\backups
IF EXIST "%p_path%\backups\*-backup.reg" md "%p_path%\backups\adminify_old"
IF EXIST "%p_path%\backups\*-backup.reg" move "%p_path%\backups\*-backup.reg" "%p_path%\backups\adminify_old"
ren "%p_path%\backups\adminify_old" "adminify_pre-%date:~4,2%-%date:~7,2%-%date:~10,4%_H%time:~0,2%_M%time:~3,2%_S%time:~3,2%"
ECHO Backing up current user/computer registry keys/subkeys/values for all
ECHO areas of the registry to be modified
ECHO.
REGEDIT /E backups\HKCU_explorer_advanced-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
REGEDIT /E backups\HKCU_explorer_cabinetstate-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState"
REGEDIT /E backups\HKCU_CP_desktop-backup.reg "HKEY_CURRENT_USER\Control Panel\Desktop"
REGEDIT /E backups\HKLM_policies_system-backup.reg "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system"
REGEDIT /E backups\HKLM_services_themes-backup.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes"
ECHO %spacer%
ECHO.
ECHO The files listed below are the backups of the registry keys/values that
ECHO will be modified. If there is nothing listed below, something is wrong
ECHO and you should close this window!
ECHO.
ECHO %spacer%
ECHO.
dir /b backups\*-backup*.reg
ECHO.
ECHO %spacer%
@pause
GOTO set_desired_values
:set_desired_values
IF NOT EXIST %p_path%\adminify_tweaked_values.reg GOTO make_files
IF NOT EXIST %p_path%\adminify_default_values.reg GOTO make_files
set step_name=adminifying (Importing desired values)
CLS
@title %p_name% - %step_name%
ECHO adminifying (Importing desired values for registry keys/subkeys we backed
ECHO up previously.)
ECHO.
REGEDIT /S adminify_tweaked_values.reg
ECHO %step_name% complete.
ECHO.
:SET __COMPAT_LAYER=WINXPSP3
ECHO Stopping the Themes service...
ECHO.
sc stop Themes
GOTO restart_explorer
:restore_create_settings
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO No backup files exist! You must adminify before de-adminifying!
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO.
IF NOT EXIST %p_path%\backups\*-backup.reg pause
IF NOT EXIST %p_path%\backups\*-backup.reg GOTO p_mainmenu
:import_default_values
set step_name=de-adminifying (step 1 - Importing Default Values)
CLS
@title %p_name% - %step_name%
ECHO Importing default values for previously imported values that may have not
ECHO existed in the registry before we started...
REGEDIT /S adminify_default_values.reg
ECHO.
ECHO %step_name% complete.
ECHO.
GOTO restore_user_settings
:restore_user_settings
set step_name=de-adminifying (step 2 - Importing User Values)
CLS
@title %p_name% - %step_name%
ECHO Restoring current user/computer registry keys/subkeys/values we backed up
ECHO before adminifying...
ECHO.
REGEDIT /S backups\HKCU_explorer_advanced-backup.reg
REGEDIT /S backups\HKCU_explorer_cabinetstate-backup.reg
REGEDIT /S backups\HKCU_CP_desktop-backup.reg
REGEDIT /S backups\HKLM_EnableLUA-backup.reg
REGEDIT /S backups\HKLM_services_themes-backup.reg
ECHO %step_name% complete.
ECHO.
ECHO Starting the Themes service (a reboot may be required)...
ECHO.
sc start Themes
ECHO.
GOTO restart_explorer
:restart_explorer
ECHO Stopping Explorer process...
ECHO.
taskkill /f /im explorer.exe
ECHO.
ECHO Wait 3 seconds...
ping -n 3 127.0.0.1 > nul
ECHO.
ECHO Starting Explorer process...
ECHO.
START %systemroot%\explorer
ECHO.
GOTO reboot_notification
:reboot_notification
ECHO %spacer%
ECHO A Logoff/Logon or Reboot is required to impose changes to User Account
ECHO Control settings and/or restart the Themes service in some cases...
ECHO %spacer%
ECHO.
GOTO done
:done
IF '%1' == 'go' ECHO adminification complete.
IF '%1' == 'un' ECHO adminification reversed.
ECHO.
@pause
IF '%1' == 'go' GOTO end
IF '%1' == 'un' GOTO end
CLS
GOTO p_mainmenu
:end
exit


#7 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 30 August 2013 - 07:34 AM

I tested the program, and everything works really well, except that on windows 7/8 the backup reg files end up in c:\windows\system32\backups.  If you move that folder back to where you ran adminify from it'll allow you to de-adminify.  That's kind of a big deal error, but it worked fine in XP - something to do with the way later OS's handle paths...

 

Here's some updated code I think will work.  Paste the code below into a file named adminify.bat.  Run it as administrator, follow the instructions, and let me know how it goes!

 

@ECHO OFF
:c_set
COLOR 2
SET spacer=*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
:p_set
SET p_path=.
SET p_name=adminify
SET p_type=.bat
set p_tools=.
@title %p_name%
:ifequal
IF '%1' == '' GOTO p_mainmenu
IF '%1' == 'go' GOTO backup_user_settings
IF '%1' == 'un' GOTO restore_create_settings
GOTO p_mainmenu
:p_about
set step_name=About adminify
CLS
@title %p_name% - %step_name%
ECHO.
ECHO The purpose of adminify is to make a computer more fixable by tweaking
ECHO the windows GUI, while  providing a way to get things back to normal after
ECHO the fixes have been performed...
ECHO.
ECHO *DISCLAIMER: This program will modify the registry of the computer you run
ECHO it on, automatically if you use arguments.  Use with caution and create a
ECHO restore point before continuing.  Of course, you can edit the .reg files in
ECHO any way you like, but the author recommends that before you do so you
ECHO understand the rationale of the order of operations used by the program
ECHO (Full Backup of Keys/Values, Modify Keys/Values, Restore Default Keys/Values,
ECHO Restore User Keys/Values.)*
ECHO.
@pause
GOTO p_mainmenu
:p_mainmenu
CLS
@Title %p_name% - Main Menu
SET substatus=p_chosen
ECHO.
ECHO Welcome to adminify!
ECHO.
ECHO Press any key to view Program Explanation and Disclaimer.
ECHO.
ECHO Main Menu:
ECHO    1. Adminify
ECHO         *Backup registry settings to be changed to \backups
ECHO         *DISABLE User Account Control - Reboot Required!
ECHO         *Make Hidden, SuperHidden, Protected Operating System Files, and
ECHO          File Extensions visible.
ECHO         *Display full path in address bar and title bar
ECHO         *STOPs and DISABLEs the Themes Service
ECHO         *STOPs and RESTARTs the explorer process
ECHO    2. De-adminify
ECHO         *Set adminified values to default
ECHO         *Re-apply backed-up user settings
ECHO         *Move backed-up user settings into a dated folder in \backups
ECHO         *RESTART stopped services and/or prompt for reboot.
ECHO    3. Open program folder to manually run .reg files
ECHO         *Do this if for some reason you adminified multiple times
ECHO          and need to restore older .reg backups.
ECHO    4. Open services.msc to manually change settings for other services
ECHO    5. Open the User Account Control Settings dialog
:ECHO    6. Not Implemented
GOTO p_choice
:p_choice
SET x=
SET /p x=Pick:
ECHO.
:p_chosen
@Title %p_name%
IF '%x%' == '1' GOTO backup_user_settings
IF '%x%' == '2' GOTO restore_create_settings
IF '%x%' == '3' START explorer %p_path%
IF '%x%' == '4' START services.msc
IF '%x%' == '5' START %systemroot%\system32\UserAccountControlSettings.exe
:IF '%x%' == '6'
GOTO p_about
:make_files
:make_file1
set mf_name=adminify_tweaked_values.reg
ECHO Windows Registry Editor Version 5.00 > %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%
ECHO "Hidden"=dword:00000001            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%
ECHO "HideFileExt"=dword:00000000        ;Hide file extentions (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "DontPrettyPath"=dword:00000001        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%
ECHO "ShowSuperHidden"=dword:00000001    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "IntelliMenus"=dword:00000000        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%
ECHO "FullPath"=dword:00000001        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "FullPathAddress"=dword:00000001    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%
ECHO "MenuShowDelay"="100"            ;Shorten menu delay (Default value "400") >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%
ECHO "EnableLUA"=dword:00000000        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%
ECHO "Start"=dword:00000004            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%
GOTO make_file2
:make_file2
set mf_name=adminify_default_values.reg
ECHO Windows Registry Editor Version 5.00 > %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%
ECHO "Hidden"=dword:00000002            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%
ECHO "HideFileExt"=dword:00000001        ;Hide file extensions (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "DontPrettyPath"=dword:00000000        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%
ECHO "ShowSuperHidden"=dword:00000000    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "IntelliMenus"=dword:00000001        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%
ECHO "FullPath"=dword:00000000        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "FullPathAddress"=dword:00000000    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%
ECHO "MenuShowDelay"="400"            ;Shorten menu delay (Default value "400") >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%
ECHO "EnableLUA"=dword:00000001        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%
ECHO "Start"=dword:00000002            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%
GOTO set_desired_values
:make_file3
REM Create code to make .lnk file to adminify.bat on desktop and assign administrator rights to it.
GOTO p_chosen
:backup_user_settings
set step_name=Backing up User Settings
CLS
@title %p_name% - %step_name%
IF NOT EXIST %p_path%\backups md %p_path%\backups
IF EXIST "%p_path%\backups\*-backup.reg" md "%p_path%\backups\adminify_old"
IF EXIST "%p_path%\backups\*-backup.reg" move "%p_path%\backups\*-backup.reg" "%p_path%\backups\adminify_old"
ren "%p_path%\backups\adminify_old" "adminify_pre-%date:~4,2%-%date:~7,2%-%date:~10,4%_H%time:~0,2%_M%time:~3,2%_S%time:~3,2%"
ECHO Backing up current user/computer registry keys/subkeys/values for all
ECHO areas of the registry to be modified
ECHO.
REGEDIT /E %p_path%\backups\HKCU_explorer_advanced-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
REGEDIT /E %p_path%\backups\HKCU_explorer_cabinetstate-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState"
REGEDIT /E %p_path%\backups\HKCU_CP_desktop-backup.reg "HKEY_CURRENT_USER\Control Panel\Desktop"
REGEDIT /E %p_path%\backups\HKLM_policies_system-backup.reg "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system"
REGEDIT /E %p_path%\backups\HKLM_services_themes-backup.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes"
ECHO %spacer%
ECHO.
ECHO The files listed below are the backups of the registry keys/values that
ECHO will be modified. If there is nothing listed below, something is wrong
ECHO and you should close this window!
ECHO.
ECHO %spacer%
ECHO.
dir /b %p_path%\backups\*-backup*.reg
ECHO.
ECHO %spacer%
@pause
GOTO set_desired_values
:set_desired_values
IF NOT EXIST %p_path%\adminify_tweaked_values.reg GOTO make_files
IF NOT EXIST %p_path%\adminify_default_values.reg GOTO make_files
set step_name=adminifying (Importing desired values)
CLS
@title %p_name% - %step_name%
ECHO adminifying (Importing desired values for registry keys/subkeys we backed
ECHO up previously.)
ECHO.
REGEDIT /S adminify_tweaked_values.reg
ECHO %step_name% complete.
ECHO.
:SET __COMPAT_LAYER=WINXPSP3
ECHO Stopping the Themes service...
ECHO.
sc stop Themes
GOTO restart_explorer
:restore_create_settings
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO No backup files exist! You must adminify before de-adminifying!
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO.
IF NOT EXIST %p_path%\backups\*-backup.reg pause
IF NOT EXIST %p_path%\backups\*-backup.reg GOTO p_mainmenu
:import_default_values
set step_name=de-adminifying (step 1 - Importing Default Values)
CLS
@title %p_name% - %step_name%
ECHO Importing default values for previously imported values that may have not
ECHO existed in the registry before we started...
REGEDIT /S adminify_default_values.reg
ECHO.
ECHO %step_name% complete.
ECHO.
GOTO restore_user_settings
:restore_user_settings
set step_name=de-adminifying (step 2 - Importing User Values)
CLS
@title %p_name% - %step_name%
ECHO Restoring current user/computer registry keys/subkeys/values we backed up
ECHO before adminifying...
ECHO.
REGEDIT /S %p_path%\backups\HKCU_explorer_advanced-backup.reg
REGEDIT /S %p_path%\backups\HKCU_explorer_cabinetstate-backup.reg
REGEDIT /S %p_path%\backups\HKCU_CP_desktop-backup.reg
REGEDIT /S %p_path%\backups\HKLM_EnableLUA-backup.reg
REGEDIT /S %p_path%\backups\HKLM_services_themes-backup.reg
ECHO %step_name% complete.
ECHO.
ECHO Starting the Themes service (a reboot may be required)...
ECHO.
sc start Themes
ECHO.
GOTO restart_explorer
:restart_explorer
ECHO Stopping Explorer process...
ECHO.
taskkill /f /im explorer.exe
ECHO.
ECHO Wait 3 seconds...
ping -n 3 127.0.0.1 > nul
ECHO.
ECHO Starting Explorer process...
ECHO.
START %systemroot%\explorer
ECHO.
GOTO reboot_notification
:reboot_notification
ECHO %spacer%
ECHO A Logoff/Logon or Reboot is required to impose changes to User Account
ECHO Control settings and/or restart the Themes service in some cases...
ECHO %spacer%
ECHO.
GOTO done
:done
IF '%1' == 'go' ECHO adminification complete.
IF '%1' == 'un' ECHO adminification reversed.
ECHO.
@pause
IF '%1' == 'go' GOTO end
IF '%1' == 'un' GOTO end
CLS
GOTO p_mainmenu
:end
exit


#8 BobbyG6200

BobbyG6200

  • Members
  • 35 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Janesville WI
  • Local time:09:59 AM

Posted 10 January 2014 - 08:56 PM

I would be happy to test it. Will it work on my XP Pro desk top? That's where my biggest headaches are right now.



#9 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 11 January 2014 - 09:27 AM

It actually works best on XP.  Let me know if it doesn't...

 

There was a bug I discovered that applies to Windows 7, etc. that does the following:

 

The backup registry files created by the program were put in a folder that was created in system32 instead of the folder you run adminify from.

 

There are two solutions:

Move the folder manually to the folder that contains adminify.bat you'll be able to use adminify to restore the settings when you're done.

Run the .reg files from their location in system32/backups.

 

Thanks for checking it out!



#10 Sirawit

Sirawit

    Bleepin' Brony


  • Malware Response Team
  • 4,161 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Thailand
  • Local time:10:59 PM

Posted 11 January 2014 - 09:45 AM

The backup files are created in system32 folder because you set p_path to "." which equal to C:\windows\system32 (Default path of CMD when Run as Administrator.)

 

I recommended you to read this topic to make your backup files create where you want. (Or in the directory where tools is run form.)

 

http://stackoverflow.com/questions/3827567/how-to-get-the-path-of-the-batch-script-in-windows

 

Thank you.


If I don't reply back to you in 2 days, feel free to send me a PM.

 

“You’re lying… just like you were lying to me before. You have to hate me. I’ve been the worst daughter in the world… you should hate me.”

“But I don’t, Nyx. Because, Nyx, I’m your mother, and a mother will always love her daughter, no matter what.” -Past sins by Pen stroke.


#11 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 11 January 2014 - 10:21 AM

@sirawit  I was planning on reverse-engineering a program like combofix to find out how he was doing it, but this is easier!  I didn't really know what question to ask...

 

Thanks for the advice!



#12 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 11 January 2014 - 11:10 AM

New code!  Only tested on Windows XP, but I think this will fix the p_path problem.  Thanks to sirawit for the advice - you're the boss!

 

@ECHO OFF
:c_set
COLOR 2
SET spacer=*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
:p_set
SET p_path=%~dp0
SET p_path=%p_path:~0,-1%
SET p_name=adminify
SET p_type=.bat
set p_tools=.
@title %p_name%
:ifequal
IF '%1' == '' GOTO p_mainmenu
IF '%1' == 'go' GOTO backup_user_settings
IF '%1' == 'un' GOTO restore_create_settings
GOTO p_mainmenu
:p_about
set step_name=About adminify
CLS
@title %p_name% - %step_name%
ECHO.
ECHO The purpose of adminify is to make a computer more fixable by tweaking
ECHO the windows GUI, while  providing a way to get things back to normal after
ECHO the fixes have been performed...
ECHO.
ECHO *DISCLAIMER: This program will modify the registry of the computer you run
ECHO it on, automatically if you use arguments.  Use with caution and create a
ECHO restore point before continuing.  Of course, you can edit the .reg files in
ECHO any way you like, but the author recommends that before you do so you
ECHO understand the rationale of the order of operations used by the program
ECHO (Full Backup of Keys/Values, Modify Keys/Values, Restore Default Keys/Values,
ECHO Restore User Keys/Values.)*
ECHO.
@pause
GOTO p_mainmenu
:p_mainmenu
CLS
@Title %p_name% - Main Menu
SET substatus=p_chosen
ECHO.
ECHO Welcome to adminify!
ECHO.
ECHO Press any key to view Program Explanation and Disclaimer.
ECHO.
ECHO Main Menu:
ECHO    1. Adminify
ECHO         *Backup registry settings to be changed to \backups
ECHO         *DISABLE User Account Control - Reboot Required!
ECHO         *Make Hidden, SuperHidden, Protected Operating System Files, and
ECHO          File Extensions visible.
ECHO         *Display full path in address bar and title bar
ECHO         *STOPs and DISABLEs the Themes Service
ECHO         *STOPs and RESTARTs the explorer process
ECHO    2. De-adminify
ECHO         *Set adminified values to default
ECHO         *Re-apply backed-up user settings
ECHO         *Move backed-up user settings into a dated folder in \backups
ECHO         *RESTART stopped services and/or prompt for reboot.
ECHO    3. Open program folder to manually run .reg files
ECHO         *Do this if for some reason you adminified multiple times
ECHO          and need to restore older .reg backups.
ECHO    4. Open services.msc to manually change settings for other services
ECHO    5. Open the User Account Control Settings dialog
:ECHO    6. Not Implemented
GOTO p_choice
:p_choice
SET x=
SET /p x=Pick:
ECHO.
:p_chosen
@Title %p_name%
IF '%x%' == '1' GOTO backup_user_settings
IF '%x%' == '2' GOTO restore_create_settings
IF '%x%' == '3' START explorer %p_path%
IF '%x%' == '4' START services.msc
IF '%x%' == '5' START %systemroot%\system32\UserAccountControlSettings.exe
:IF '%x%' == '6'
GOTO p_about
:make_files
:make_file1
set mf_name=adminify_tweaked_values.reg
ECHO Windows Registry Editor Version 5.00 > %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%
ECHO "Hidden"=dword:00000001            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%
ECHO "HideFileExt"=dword:00000000        ;Hide file extentions (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "DontPrettyPath"=dword:00000001        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%
ECHO "ShowSuperHidden"=dword:00000001    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "IntelliMenus"=dword:00000000        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%
ECHO "FullPath"=dword:00000001        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "FullPathAddress"=dword:00000001    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%
ECHO "MenuShowDelay"="100"            ;Shorten menu delay (Default value "400") >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%
ECHO "EnableLUA"=dword:00000000        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%
ECHO "Start"=dword:00000004            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%
GOTO make_file2
:make_file2
set mf_name=adminify_default_values.reg
ECHO Windows Registry Editor Version 5.00 > %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%
ECHO "Hidden"=dword:00000002            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%
ECHO "HideFileExt"=dword:00000001        ;Hide file extensions (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "DontPrettyPath"=dword:00000000        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%
ECHO "ShowSuperHidden"=dword:00000000    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "IntelliMenus"=dword:00000001        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%
ECHO "FullPath"=dword:00000000        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO "FullPathAddress"=dword:00000000    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%
ECHO "MenuShowDelay"="400"            ;Shorten menu delay (Default value "400") >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%
ECHO "EnableLUA"=dword:00000001        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%
ECHO. >> %mf_name%
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%
ECHO "Start"=dword:00000002            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%
GOTO set_desired_values
:make_file3
REM Create code to make .lnk file to adminify.bat on desktop and assign administrator rights to it.
GOTO p_chosen
:backup_user_settings
set step_name=Backing up User Settings
CLS
@title %p_name% - %step_name%
IF NOT EXIST %p_path%\backups md %p_path%\backups
IF EXIST "%p_path%\backups\*-backup.reg" md "%p_path%\backups\adminify_old"
IF EXIST "%p_path%\backups\*-backup.reg" move "%p_path%\backups\*-backup.reg" "%p_path%\backups\adminify_old"
ren "%p_path%\backups\adminify_old" "adminify_pre-%date:~4,2%-%date:~7,2%-%date:~10,4%_H%time:~0,2%_M%time:~3,2%_S%time:~3,2%"
ECHO Backing up current user/computer registry keys/subkeys/values for all
ECHO areas of the registry to be modified
ECHO.
REGEDIT /E %p_path%\backups\HKCU_explorer_advanced-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
REGEDIT /E %p_path%\backups\HKCU_explorer_cabinetstate-backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState"
REGEDIT /E %p_path%\backups\HKCU_CP_desktop-backup.reg "HKEY_CURRENT_USER\Control Panel\Desktop"
REGEDIT /E %p_path%\backups\HKLM_policies_system-backup.reg "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system"
REGEDIT /E %p_path%\backups\HKLM_services_themes-backup.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes"
ECHO %spacer%
ECHO.
ECHO The files listed below are the backups of the registry keys/values that
ECHO will be modified. If there is nothing listed below, something is wrong
ECHO and you should close this window!
ECHO.
ECHO %spacer%
ECHO.
dir /b %p_path%\backups\*-backup*.reg
ECHO.
ECHO %spacer%
@pause
GOTO set_desired_values
:set_desired_values
IF NOT EXIST %p_path%\adminify_tweaked_values.reg GOTO make_files
IF NOT EXIST %p_path%\adminify_default_values.reg GOTO make_files
set step_name=adminifying (Importing desired values)
CLS
@title %p_name% - %step_name%
ECHO adminifying (Importing desired values for registry keys/subkeys we backed
ECHO up previously.)
ECHO.
REGEDIT /S adminify_tweaked_values.reg
ECHO %step_name% complete.
ECHO.
:SET __COMPAT_LAYER=WINXPSP3
ECHO Stopping the Themes service...
ECHO.
sc stop Themes
GOTO restart_explorer
:restore_create_settings
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO No backup files exist! You must adminify before de-adminifying!
IF NOT EXIST %p_path%\backups\*-backup.reg ECHO.
IF NOT EXIST %p_path%\backups\*-backup.reg pause
IF NOT EXIST %p_path%\backups\*-backup.reg GOTO p_mainmenu
:import_default_values
set step_name=de-adminifying (step 1 - Importing Default Values)
CLS
@title %p_name% - %step_name%
ECHO Importing default values for previously imported values that may have not
ECHO existed in the registry before we started...
REGEDIT /S adminify_default_values.reg
ECHO.
ECHO %step_name% complete.
ECHO.
GOTO restore_user_settings
:restore_user_settings
set step_name=de-adminifying (step 2 - Importing User Values)
CLS
@title %p_name% - %step_name%
ECHO Restoring current user/computer registry keys/subkeys/values we backed up
ECHO before adminifying...
ECHO.
REGEDIT /S %p_path%\backups\HKCU_explorer_advanced-backup.reg
REGEDIT /S %p_path%\backups\HKCU_explorer_cabinetstate-backup.reg
REGEDIT /S %p_path%\backups\HKCU_CP_desktop-backup.reg
REGEDIT /S %p_path%\backups\HKLM_EnableLUA-backup.reg
REGEDIT /S %p_path%\backups\HKLM_services_themes-backup.reg
ECHO %step_name% complete.
ECHO.
ECHO Starting the Themes service (a reboot may be required)...
ECHO.
sc start Themes
ECHO.
GOTO restart_explorer
:restart_explorer
ECHO Stopping Explorer process...
ECHO.
taskkill /f /im explorer.exe
ECHO.
ECHO Wait 3 seconds...
ping -n 3 127.0.0.1 > nul
ECHO.
ECHO Starting Explorer process...
ECHO.
START %systemroot%\explorer
ECHO.
GOTO reboot_notification
:reboot_notification
ECHO %spacer%
ECHO A Logoff/Logon or Reboot is required to impose changes to User Account
ECHO Control settings and/or restart the Themes service in some cases...
ECHO %spacer%
ECHO.
GOTO done
:done
IF '%1' == 'go' ECHO adminification complete.
IF '%1' == 'un' ECHO adminification reversed.
ECHO.
@pause
IF '%1' == 'go' GOTO end
IF '%1' == 'un' GOTO end
CLS
GOTO p_mainmenu
:end
exit


#13 Sirawit

Sirawit

    Bleepin' Brony


  • Malware Response Team
  • 4,161 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Thailand
  • Local time:10:59 PM

Posted 11 January 2014 - 11:22 AM

Does not works on Windows XP, in Windows 7 registry Backup works fine, although, make_files section is the Infinite Looping, I cannot dig the bug for you since I'm busy, but will will find it. :)

 

Thank you.


If I don't reply back to you in 2 days, feel free to send me a PM.

 

“You’re lying… just like you were lying to me before. You have to hate me. I’ve been the worst daughter in the world… you should hate me.”

“But I don’t, Nyx. Because, Nyx, I’m your mother, and a mother will always love her daughter, no matter what.” -Past sins by Pen stroke.


#14 BobbyG6200

BobbyG6200

  • Members
  • 35 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Janesville WI
  • Local time:09:59 AM

Posted 11 January 2014 - 12:24 PM

This is another topic but you gentlemen might just have a solution. Windows XP Pro, my Win32  can't communicate (system cannot find the path specified)  with my services.mcs. My whole services directory is messed up. I'm not sure what I did, but everything else seems OK. Had an issue where I  reinstalled a program for Bluetooth called BlueSoliel, which I had temporarily removed. Now it gets an 'exception' default and everytime i try to start the program the 'system' disables my Bluetooth services. This is how I found the problem in the services folder.
 
 Sorry I  don't understand your shortcut : Control/'Cmd'+V

And  I can''t figure out how to add a screen shot. Sorry



#15 tellus

tellus
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:10:59 AM

Posted 11 January 2014 - 01:04 PM

 Sorry I  don't understand your shortcut : Control/'Cmd'+V

 

I just mean Ctrl+v as in paste - you can select, copy, and paste the code into a file called adminify.bat

 

As for your other issue, first thing is that it's services.msc, not services.mcs

 

If restoring to a recent restore point doesn't fix it, there are other tools you can run to hopefully make things better and at least get most services that may have been screwed up set back to default settings.

  • Completely uninstall the program in question using Add/Remove Programs or Revo Uninstaller
  • Run sfc /scannow to look for problems (search the forums for more in-depth instructions)
  • Download and run Windows Repair (All In One)
    • Please note you don't want to run all the fixes - just the ones that will hopefully return the functionality you've lost.  There should not be a lot of boxes ticked - if you run it like that you're asking for problems...

Then try to reinstall your program and see if your services behave.

 

This topic may be moved by admins to a more appropriate place where you can get the right kind of help, but I hope this gets you started :-)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users