New
#1
Help with taking ownership of system file using a batch file.
I'm making a batch file to reinstall some reg files back in to the registry after i rebuild windows. I also want to take ownership of a file in system32 and then replace it with a modified version containing extra icons i put in there.
I'm hoping that as long as the files the .reg and .dll files are in the same folder as the batch file it will work.
So does anyone know what command I can use to take ownership of a file then replace it. I know i use xcopy to replace just not sure how i implement it.
Also no big deal but will be cool on how i can make each part colorized. Like where i have my notes at, i want it to be green as to stand out so it will be read.
Here is my file so far.
Code:@echo Off Mode 100,43 :MENU ECHO ______ __ __ ______ __ __ ______ ______ __ ______ ______ ECHO /\ ___\ /\ "-.\ \ /\ __ \ /\ \/ / /\ ___\ /\ ___\ /\ \ /\ ___\ /\__ _\ ECHO \ \___ \ \ \ \-. \ \ \ __ \ \ \ _"-. \ \ __\ \ \ __\ \ \ \ \ \___ \ \/_/\ \/ ECHO \/\_____\ \ \_"\_\ \ \_\ \_\ \ \_\ \_\ \ \_____\ \ \_\ \ \_\ \/\_____\ \ \_\ ECHO \/_____/ \/_/ \/_/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ \/_/ \/_____/ \/_/ ECHO. ECHO ___________________________________________________________ ECHO *Notes* ECHO Make Sure To Have Photoshop CC 2015 Installed For The Edit ECHO On Right Click Menu To Open Images In Photoshop. ECHO ___________________________________________________________ ECHO Make Sure imageres.dll Is Copied Over To System32 Folder ECHO For Hard Drive Icons, Command Prompt Icon And Power Options ECHO Cascade Menu On Right Click Icons To Show Up. ECHO *Notes* ECHO ___________________________________________________________ ECHO. ECHO. ECHO. ECHO ----------------------------------------------------------- ECHO PRESS 1, 2, 3, 4, 5, 6 to select your task, or 7 to EXIT. ECHO ----------------------------------------------------------- ECHO. ECHO 1 - Change Edit To Open Photoshop ECHO 2 - Enable Logon In Windows 7 ECHO 3 - HDD Icons ECHO 4 - Open Command Prompt Here With Icon ECHO 5 - Power Options Cascade Menu On Right Click ECHO 6 - Take Ownership Of Files ECHO 7 - EXIT ECHO. ECHO 1 - Change Edit To Open Photoshop ECHO 2 - Enable Logon In Windows 7 ECHO 3 - HDD Icons ECHO 4 - Open Command Prompt Here With Icon ECHO 5 - Power Options Cascade Menu On Right Click ECHO 6 - Take Ownership Of Files ECHO 7 - EXIT ECHO. SET /P M=Type 1, 2, 3, or 4 then press ENTER: IF %M%==1 Change Edit To Open Photoshop IF %M%==2 Enable Logon In Windows 7 IF %M%==3 HDD Icons IF %M%==4 Open Command Prompt Here With Icon IF %M%==5 Power Options Cascade Menu On Right Click IF %M%==6 Take Ownership Of Files IF %M%==7 GOTO EOF :Registry Entry cd regedit.exe /s Change Edit To Open Photoshop.reg start regedit.exe GOTO MENU :Registry Entry cd regedit.exe /s Enable Logon In Windows 7.reg start regedit.exe GOTO MENU :Registry Entry cd regedit.exe /s HDD Icons.reg start regedit.exe GOTO MENU :Registry Entry cd regedit.exe /s Open Command Prompt Here Icon.reg start regedit.exe GOTO MENU :Registry Entry cd regedit.exe /s Power Options Cascade Menu On Right Click.reg start regedit.exe GOTO MENU :Registry Entry cd regedit.exe /s Take Ownership Of Files.reg start regedit.exe GOTO MENU
Last edited by SnakeFist; 07 May 2017 at 00:13. Reason: Cause the text is coming up like it's greyed out.