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.

Generic User Avatar

Adminify


  • Please log in to reply
22 replies to this topic

#16 tellus

tellus
  • Topic Starter

  •  Avatar image
  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:02:36 AM

Posted 11 January 2014 - 01:14 PM

@sirawit I cannot dig the bug for you since I'm busy, but will will find it. :)

 

I see what's wrong - I need to make sure all the paths are more explicitly defined now that I have the magic skillz to capture the correct p_path value.  Strange that it works fine on my xp computer and loops on yours, but I'm not surprised :-) 

Then I need to figure out how to remove double quotes so that I can run it from paths that contain spaces...

I'll post back when I get a chance to do that work - thanks for beta testing!



BC AdBot (Login to Remove)

 


#17 BobbyG6200

BobbyG6200

  •  Avatar image
  • Members
  • 35 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Janesville WI
  • Local time:01:36 AM

Posted 11 January 2014 - 01:21 PM

My  Reference to the short cut key was in response to the box that popped up when I tried to paste a screen shot.

Yes I  ran the All in one last night. I still have a dysfunctional services.msc. Pardon me I get dyslexic at times.

Thanks for the suggestion.



#18 Romeo29

Romeo29

    Learning To Bleep


  •  Avatar image
  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:02:36 AM

Posted 21 January 2014 - 10:25 PM

You should also add command to enable and start some of the important Windows sevices which might become disabled by malware infection. For example Windows Firewall service. The command is SC that you can use.



#19 BobbyG6200

BobbyG6200

  •  Avatar image
  • Members
  • 35 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Janesville WI
  • Local time:01:36 AM

Posted 22 January 2014 - 01:41 AM

I'm sorry. I was a 'coward' LOL and took the easy way  out. Turned out it wasn't so easy though. Actually my system was running fairly well. Somehow I corrupted the list of dependencies. That is to re-install my OS. I had made one of those 'slip streamed' unattended recovery discs and t was a disaster. The end result was UGLY and slow. I got error messages from the get go. Then my machine wouldn't boot from the installation disc or turn on at all. I got lucky though. Did a little Goggling. I managed to get into  the BIOS and did the memory check and it repaired itself. I had managed to  gain control of the PC and now have total Admin rights on both my systems. Right now I'm working on a iMac G4 and starting to  make some headway on a machine that was totally dysfunctional. Well I have to get back to installing my virtual Android app on my desk top.

Thanks.



#20 JohnnyJammer

JohnnyJammer

  •  Avatar image
  • Members
  • 1,268 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:QLD Australia
  • Local time:05:36 PM

Posted 23 January 2014 - 01:33 AM

Not being picky but

SET x=
SET /p x=Pick:
Should be (SET /p x=Pick:) because all you are  doing is nothing with just SET x= anyway, i always use the /p and set the command after the = instead of so many ECHO's

 

Anwyay i havnt had time to read it all and also (Just my 2 cents mate) i would be creating all that ECHo stuff in a notepad file like title.txt and then use the command (type title.txt) when you want to echo all that text.

it makes the batch file clean and tidy when heaps of text is done. Ill do some changes when i get time to show you what i mean.


 



#21 JohnnyJammer

JohnnyJammer

  •  Avatar image
  • Members
  • 1,268 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:QLD Australia
  • Local time:05:36 PM

Posted 23 January 2014 - 01:42 AM

Like so by creating multiple text files to read from, i can sthe actual script very small if you use the type command, also have you ever tried WMIC?

 

 

create disclaimer.txt file

The purpose of adminify is to make a computer more fixable by tweaking

the windows GUI, while  providing a way to get things back to normal after

the fixes have been performed...



*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.)*

Create welcome.txt

Welcome to adminify!

Press any key to view Program Explanation and Disclaimer.

Main Menu:

   1. Adminify

        *Backup registry settings to be changed to \backups

        *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

        *STOPs and DISABLEs the Themes Service

        *STOPs and RESTARTs the explorer process

   2. De-adminify

        *Set adminified values to default

        *Re-apply backed-up user settings

        *Move backed-up user settings into a dated folder in \backups

        *RESTART stopped services and/or prompt for reboot.

   3. Open program folder to manually run .reg files

        *Do this if for some reason you adminified multiple times

         and need to restore older .reg backups.

   4. Open services.msc to manually change settings for other services

   5. Open the User Account Control Settings dialog

   6. Not Implemented

Create regdisplay1.txt

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%

"AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%

"Hidden"=dword:00000001            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%

"HideFileExt"=dword:00000000        ;Hide file extentions (1=Enabled, 0=Disabled) >> %mf_name%

"DontPrettyPath"=dword:00000001        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%

"ShowSuperHidden"=dword:00000001    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%

"IntelliMenus"=dword:00000000        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%

ECHO. >> %mf_name%

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%

"FullPath"=dword:00000001        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%

"FullPathAddress"=dword:00000001    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%

ECHO. >> %mf_name%

[HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%

"MenuShowDelay"="100"            ;Shorten menu delay (Default value "400") >> %mf_name%

ECHO. >> %mf_name%

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%

"EnableLUA"=dword:00000000        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%

ECHO. >> %mf_name%

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%

"Start"=dword:00000004            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%

create regdisplay2.txt

Windows Registry Editor Version 5.00 > %mf_name%

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> %mf_name%

"AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> %mf_name%

"Hidden"=dword:00000002            ;Show hidden files and folders (1=Do, 2=Don't) >> %mf_name%

"HideFileExt"=dword:00000001        ;Hide file extensions (1=Enabled, 0=Disabled) >> %mf_name%

"DontPrettyPath"=dword:00000000        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> %mf_name%

"ShowSuperHidden"=dword:00000000    ;I'm not really sure (1=Enabled, 0=Disabled) >> %mf_name%

"IntelliMenus"=dword:00000001        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> %mf_name%

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> %mf_name%

"FullPath"=dword:00000000        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> %mf_name%

"FullPathAddress"=dword:00000000    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> %mf_name%

[HKEY_CURRENT_USER\Control Panel\Desktop] >> %mf_name%

"MenuShowDelay"="400"            ;Shorten menu delay (Default value "400") >> %mf_name%

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> %mf_name%

"EnableLUA"=dword:00000001        ;Enable UAC (1=Enabled, 0=Disabled) >> %mf_name%

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> %mf_name%

"Start"=dword:00000002            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> %mf_name%

You get qwhere this is going, i havnt done the rest but im sure you could

After that the edit version would look like so

@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%

:: Show the disclaimer text

type disclaimer.txt

@pause

GOTO p_mainmenu

:p_mainmenu

CLS

@Title %p_name% - Main Menu

SET substatus=p_chosen

::Create the Welcome message

type welcome.txt

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

:: Display the registry changes

type regdisplay1.txt

GOTO make_file2

:make_file2

set mf_name=adminify_default_values.reg

:: Display registry changes

type regdisplay2.txt

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


#22 tellus

tellus
  • Topic Starter

  •  Avatar image
  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:02:36 AM

Posted 19 February 2014 - 01:45 PM

@JohnnyJammer That's pretty cool, I've not done that before!  I'm trying to make it so that it's a single file to begin with, but if I could figure out how to send it out as a self-extracting zip or something I'd do that - it's certainly a lot less instructions that need to be read by the computer!

 

@Romeo29 That would be good to do, but I'm not trying to fix the machines with this program per say - I'm just trying to figure a quick way to turn off all the stuff microsoft came up with since windows 2000 that does nothing but slow me down (UAC, Themes, Aero, Hidden Menus, etc.) and then return things to normal afterwards.  I find myself turning this stuff off manually and then forgetting how the user had it set up in the first place.



#23 tellus

tellus
  • Topic Starter

  •  Avatar image
  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:02:36 AM

Posted 19 February 2014 - 01:59 PM

By the way, the new code is below.  Here's what was fixed and/or added:

  • Tested on win7 as neutered UAC administrator
  • Tested on win7 as administrator (UAC Disabled)
  • Tested from paths containing spaces
  • Added an option to run automatically with 'toggle' argument
    • Just create a shortcut to the program and edit the "target" to read something like "C:\Test Directory\adminify.bat" toggle

Thanks for beta testing!  You can test by copying the code below into a file called adminify.bat

 

@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=.
SET f_path=%p_path%\adminify_files
@title %p_name%
:ifequal
IF NOT EXIST "%f_path%\adminify_status*" SET c_status=not yet adminified
IF EXIST "%f_path%\adminify_status-adminified" SET c_status=adminified
IF EXIST "%f_path%\adminify_status-deadminified" SET c_status=de-adminified
IF '%1' == '' GOTO p_mainmenu
IF '%1' == 'toggle' SET toggle=on
IF '%1' == 'toggle' GOTO toggle
IF '%1' == 'go' GOTO backup_user_settings
IF '%1' == 'un' GOTO restore_create_settings
GOTO p_mainmenu
:toggle
IF '%c_status%' == 'not yet adminified' GOTO make_folders
IF '%c_status%' == 'adminified' GOTO restore_create_settings
IF '%c_status%' == 'de-adminified' GOTO make_folders
:p_about
set step_name=About adminify
CLS
@title %p_name% - %step_name%
ECHO.
ECHO Your System Status is: %c_status%
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 A reboot is required to change some settings, but some changes take
ECHO place immediately.
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 ifequal
:p_mainmenu
CLS
@Title %p_name% - Main Menu
@Title %p_name% - Main Menu (System Status: %c_status%)
SET substatus=p_chosen
ECHO.
ECHO Welcome to adminify!
ECHO.
ECHO Press any key to view Program Explanation and Disclaimer.
ECHO Actions in parentheses are not yet implemented.
ECHO.
ECHO Main Menu:
ECHO    1. Adminify
ECHO         *Backup registry settings to be changed to \adminify_files
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 \adminify_files
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 make_folders
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_folders
IF EXIST "%p_path%\backups" ren "%p_path%\backups" adminify_files
IF NOT EXIST "%f_path%" md "%f_path%"
IF NOT EXIST "%f_path%\adminify_status-*" ECHO. > "%f_path%\adminify_status-null"
IF EXIST "%f_path%\*.reg" md "%f_path%\adminify_files_old"
IF EXIST "%f_path%\*-backup.reg" move "%f_path%\*-backup.reg" "%f_path%\adminify_files_old"
IF EXIST "%f_path%\*tweaked*.reg" copy "%f_path%\*tweaked*.reg" "%f_path%\adminify_files_old"
IF EXIST "%f_path%\*default*.reg" move "%f_path%\*default*.reg" "%f_path%\adminify_files_old"
ren "%f_path%\adminify_files_old" "adminify_files_pre-%date:~4,2%-%date:~7,2%-%date:~10,4%_H%time:~0,2%_M%time:~3,2%_S%time:~3,2%"
GOTO backup_user_settings
:make_files
:make_file1
set mf_name=adminify_tweaked_values.reg
IF EXIST "%f_path%\%mf_name%" ECHO %mf_name% exists already, overwrite?
IF EXIST "%f_path%\%mf_name%" SET /p yn=y or n? (usually y):
IF '%yn%' == 'n' GOTO make_file2
ECHO Windows Registry Editor Version 5.00 > "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> "%f_path%\%mf_name%"
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> "%f_path%\%mf_name%"
ECHO "Hidden"=dword:00000001            ;Show hidden files and folders (1=Do, 2=Don't) >> "%f_path%\%mf_name%"
ECHO "HideFileExt"=dword:00000000        ;Hide file extentions (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO "DontPrettyPath"=dword:00000001        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> "%f_path%\%mf_name%"
ECHO "ShowSuperHidden"=dword:00000001    ;I'm not really sure (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO "IntelliMenus"=dword:00000000        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> "%f_path%\%mf_name%"
ECHO "FullPath"=dword:00000001        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO "FullPathAddress"=dword:00000001    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> "%f_path%\%mf_name%"
ECHO "MenuShowDelay"="100"            ;Shorten menu delay (Default value "400") >> "%f_path%\%mf_name%"
ECHO "Wallpaper"=""                ;Disables Desktop Wallpaper >> "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> "%f_path%\%mf_name%"
ECHO "EnableLUA"=dword:00000000        ;Enable UAC (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> "%f_path%\%mf_name%"
ECHO "Start"=dword:00000004            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> "%f_path%\%mf_name%"
GOTO make_file2
:make_file2
set mf_name=adminify_default_values.reg
ECHO Windows Registry Editor Version 5.00 > "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] >> "%f_path%\%mf_name%"
ECHO "AlwaysShowMenus"=dword:00000001    ;Show menu in Windows Explorer (1=Do, 0=Don't) >> "%f_path%\%mf_name%"
ECHO "Hidden"=dword:00000002            ;Show hidden files and folders (1=Do, 2=Don't) >> "%f_path%\%mf_name%"
ECHO "HideFileExt"=dword:00000001        ;Hide file extensions (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO "DontPrettyPath"=dword:00000000        ;Files/directories in all caps displayed as mixed-case (1=False, 0=True) >> "%f_path%\%mf_name%"
ECHO "ShowSuperHidden"=dword:00000000    ;I'm not really sure (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO "IntelliMenus"=dword:00000001        ;Menus (such as the start menu) are personalized (1=True, 0=False) >> "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] >> "%f_path%\%mf_name%"
ECHO "FullPath"=dword:00000000        ;Display the Full Path in the Title Bar (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO "FullPathAddress"=dword:00000000    ;Display the Full Path in the Address Bar (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_CURRENT_USER\Control Panel\Desktop] >> "%f_path%\%mf_name%"
ECHO "MenuShowDelay"="400"            ;Shorten menu delay (Default value "400") >> "%f_path%\%mf_name%"
ECHO "Wallpaper"=""                ;Disables Desktop Wallpaper
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system] >> "%f_path%\%mf_name%"
ECHO "EnableLUA"=dword:00000001        ;Enable UAC (1=Enabled, 0=Disabled) >> "%f_path%\%mf_name%"
ECHO. >> "%f_path%\%mf_name%"
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] >> "%f_path%\%mf_name%"
ECHO "Start"=dword:00000002            ;Themes Service (2=Automatic[Default], 3=Manual, 4=Disabled) >> "%f_path%\%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%
ECHO Backing up current user/computer registry keys/subkeys/values for all
ECHO areas of the registry to be modified
ECHO.
REGEDIT /E "%f_path%\HKCU_explorer_advanced-backup.reg" "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
REGEDIT /E "%f_path%\HKCU_explorer_cabinetstate-backup.reg" "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState"
REGEDIT /E "%f_path%\HKCU_CP_desktop-backup.reg" "HKEY_CURRENT_USER\Control Panel\Desktop"
REGEDIT /E "%f_path%\HKLM_policies_system-backup.reg" "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system"
REGEDIT /E "%f_path%\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 "%f_path%\"
ECHO.
ECHO %spacer%
@pause
GOTO set_desired_values
:set_desired_values
IF NOT EXIST "%f_path%\adminify_tweaked_values.reg" GOTO make_files
IF NOT EXIST "%f_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 "%f_path%\adminify_tweaked_values.reg"
ECHO %step_name% complete.
ECHO.
:SET __COMPAT_LAYER=WINXPSP3
ECHO Stopping the Themes service...
ECHO.
sc stop Themes
ECHO Setting adminify status
ECHO.
ren "%f_path%\adminify_status-*" adminify_status-adminified
GOTO restart_explorer
:restore_create_settings
IF NOT EXIST "%f_path%\*-backup.reg" ECHO No backup files exist! You must adminify before de-adminifying!
IF NOT EXIST "%f_path%\*-backup.reg" ECHO.
IF NOT EXIST "%f_path%\*-backup.reg" pause
IF NOT EXIST "%f_path%\*-backup.reg" GOTO ifequal
: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 "%f_path%\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 "%f_path%\HKCU_explorer_advanced-backup.reg"
REGEDIT /S "%f_path%\HKCU_explorer_cabinetstate-backup.reg"
REGEDIT /S "%f_path%\HKCU_CP_desktop-backup.reg"
REGEDIT /S "%f_path%\HKLM_EnableLUA-backup.reg"
REGEDIT /S "%f_path%\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.
ECHO Setting adminify status...
ECHO.
ren "%f_path%\adminify_status-*" adminify_status-deadminified
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 '%toggle%' == 'on' GOTO exit
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 ifequal
:end
exit










1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users