I am a school technician and I was asked to make all classes computers accessibles from psexec. I'm quite new to this tool but another techician said that this is what we needed so I have written this .bat file that is supposed to automatically install psexec from my flash drive and allow everything needed to use It. The purpose was to make my work faster then manually install psexec on all 43 computers. Unfortunately this executable works perfectly on the server computers but when I try to connect to those from a Client computer they all return one of these two errors (I believe randomly):
"Make sure that the default admin$ share is enabled"
"Couldn't access xxx.xxx.xx.xx: The user name or password is incorrect."
All the computer are in a workgroup so I have to run this bat one computer at a time.
What do I have to add to my .bat file to reach my purpose?
Could you please help me to complete my project? Thank you <3
Here's the code (after this there's the explanation):
#echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"="
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
set "Host-address="
set Host-address=xxx.xxx.xx.xx
set /p NAME="Name: "
for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a
echo %NetworkIP% >"%~d0\Server installation\IP"\%NAME%.txt
SETLOCAL
SET "admins="
SET "prev="
FOR /f "delims=" %%A IN ('net localgroup administrators') DO (
CALL SET "admins=%%admins%% %%prev%%"
SET "prev=%%A")
SET admins=%admins:*- Administrator =%
echo %admins%> "%~d0\Server installation\Username"\%NAME%.txt
PowerShell.exe -Command "Set-ExecutionPolicy Bypass"
PowerShell.exe -Command "Set-NetFirewallRule -DisplayGroup 'File and Printer Sharing' -Enabled True -Profile Any"
PowerShell.exe -Command "Set-NetFirewallRule -DisplayGroup 'File and Printer Sharing over SMBDirect' -Enabled True -Profile Any"
PowerShell.exe -Command "Enable-PSRemoting -Force"
powerShell.exe -Command "Set-Item WSMan:\localhost\Client\TrustedHosts -value %Host-address% -Force"
PowerShell.exe -Command "Restart-Service WInRM"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 0 /f
PowerShell.exe -Command "Set-ItemProperty -Name AutoShareWks -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Value 1"
xcopy "%~d0\Server installation\PSTools" "C:\Windows\System32\PSTools" /E /H /C /I /Y
setx /M Path "%path%;C:\Windows\System32\PSTools"
PowerShell.exe -Command "psexec"
PowerShell.exe -Command "psexec /accepteula"
net share admin$ delete
net share C:\Windows /delete
net share admin$ /UNLIMITED
net share admin="C:\Windows" /GRANT:"%admins%",Full /UNLIMITED
netsh advfirewall firewall add rule name="TCP Port 445" dir=in action=allow protocol=TCP localport=445
netsh advfirewall firewall add rule name="TCP Port 135" dir=in action=allow protocol=TCP localport=135
Here's the explanation of what I have writed since now:
Automatically runs the bat file as Admin:
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"="
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
To make my work easier if I ever wanted to change the ip of the client i created a variable with the client ip, so wherever i needed It I just used the variable value:
set Host-address=xxx.xxx.xx.xx
Creates a variable that askes me the name of the computer to save the following files with Its name:
set /p NAME="Name: "
Saves the ip of the computer I'm running the bat on in a folder called
"IP", inside the folder "Server Installation", in my flash drive that has a variable letter assigned "%~d0" (that's because very often I have multiple flash drives connected to this computers):
for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a
echo %NetworkIP% >"%~d0\Server installation\IP"\%NAME%.txt
Saves the adminastrator's name in a folder called "Username" always in the "Server installation" folder in the same flash drive:
SETLOCAL
SET "admins="
SET "prev="
FOR /f "delims=" %%A IN ('net localgroup administrators') DO (
CALL SET "admins=%%admins%% %%prev%%"
SET "prev=%%A")
SET admins=%admins:*- Administrator =%
echo %admins%> "%~d0\Server installation\Username"\%NAME%.txt
Lets me execute any command, enables "File and Printer Sharing", enables "File and Printer Sharing over SMBDirect", enables "PSRemoting", adds my host address as a trusted host and finally restarts "WInRM":
PowerShell.exe -Command "Set-ExecutionPolicy Bypass"
PowerShell.exe -Command "Set-NetFirewallRule -DisplayGroup 'File and Printer Sharing' -Enabled True -Profile Any"
PowerShell.exe -Command "Set-NetFirewallRule -DisplayGroup 'File and Printer Sharing over SMBDirect' -Enabled True -Profile Any"
PowerShell.exe -Command "Enable-PSRemoting -Force"
powerShell.exe -Command "Set-Item WSMan:\localhost\Client\TrustedHosts -value %Host-address% -Force"
PowerShell.exe -Command "Restart-Service WInRM"
Enable C$ sharing and sets the C$ sharing as automatic:
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 0 /f
PowerShell.exe -Command "Set-ItemProperty -Name AutoShareWks -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Value 1"
Installs the "pstools" folder containing the "psexec" tool inside my flash drive inside the computer, add its path to the system path variables and accepts psexec eula:
xcopy "%~d0\Server installation\PSTools" "C:\Windows\System32\PSTools" /E /H /C /I /Y
setx /M Path "%path%;C:\Windows\System32\PSTools"
PowerShell.exe -Command "psexec"
PowerShell.exe -Command "psexec /accepteula"
Erases any admin$ sharing and ant "C:\Windows" sharing, shares admin$ again and then shares "C:\Windows" with the name "admin" to my administrator's name. Then opens the 445 port and the 135 port:
net share admin$ delete
net share C:\Windows /delete
net share admin$ /UNLIMITED
net share admin="C:\Windows" /GRANT:"%admins%",Full /UNLIMITED
netsh advfirewall firewall add rule name="TCP Port 445" dir=in action=allow protocol=TCP localport=445
netsh advfirewall firewall add rule name="TCP Port 135" dir=in action=allow protocol=TCP localport=135
Related
I created a batch file named runServer.bat to run activeMq,redis...
#echo off
echo run activemq
start cmd /k "title activemq&&cd .\apache-activemq-5.16.5\bin\win64&&activemq.bat"
TIMEOUT /T 3
echo run Redis
start cmd /k "title redis&&cd .\Redis&&redis-server redis.windows.conf"
TIMEOUT /T 3
I put the batch file register windows server as a service.
#echo off
echo 获取Administrator权限
cacls.exe "%SystemDrive%\System Volume Information" >nul 2>nul
if %errorlevel%==0 goto Admin
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
echo Set RequestUAC = CreateObject^("Shell.Application"^)>"%temp%\getadmin.vbs"
echo RequestUAC.ShellExecute "%~s0","","","runas",1 >>"%temp%\getadmin.vbs"
echo WScript.Quit >>"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs" /f
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
exit
:Admin
echo 成功取得Administrator权限
C:\Users\zps\Desktop\test\instsrv.exe CecWlwServerTest3 C:\Users\zps\Desktop\test\srvany.exe
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CecWlwServerTest3\Parameters
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CecWlwServerTest3\Parameters /v AppDirectory /d "E:\batTest\package" /t reg_sz /f
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CecWlwServerTest3\Parameters /v Application /d "E:\batTest\package\runServer.bat" /t reg_sz /f
enter image description here
When I close this windows service, the corresponding process is not closed.
activeMq and redis processes are still in progress.
enter image description here
enter image description here
How can I close the process started by the service at the same time when I close the service
The scope is running from the user's local computer.
You can use this to get the active user's SID.
Then you could use this with the HKU registry hive.
#ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
ECHO GET THE NAME OF THE ACTIVELY LOGGED ON USER
FOR /F "skip=1" %%G IN ('wmic computersystem get username') DO (
SET aUSER=%%G
GOTO EXITLOOP1
)
:EXITLOOP1
ECHO %aUSER%
ECHO[
REM ECHO TRIM THE USERNAME
SET tUSER=%aUSER:~4%
REM ECHO %tUSER%
ECHO[
ECHO GET SID FOR USER: %tUSER%
FOR /F "usebackq skip=1" %%a IN (`WMIC USERACCOUNT WHERE NAME^='%%tUSER%%' GET SID`) DO (
SET SID=%%a
GOTO EXITLOOP2
)
:EXITLOOP2
ECHO %SID%
BTW, if you wanted to do it without a For loop, you could ask powershell to assist:
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command "(%SystemRoot%\System32\whoami.exe /User /Fo CSV | ConvertFrom-Csv).SID"
Or even without whoami.exe:
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command "Add-Type -AssemblyName System.DirectoryServices.AccountManagement;$([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value"
In a cmd.exe console the following command can be used.
powershell -NoLogo -NoProfile -Command ^
"Add-Type -AssemblyName System.DirectoryServices.AccountManagement;" ^
"([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).Sid.AccountDomainSid.Value"
To get the result into a variable, use a FOR loop. (Yeah, I know, it's crazy, right?)
FOR /F "delims=" %%A IN ('powershell -NoLogo -NoProfile -Command ^
"Add-Type -AssemblyName System.DirectoryServices.AccountManagement;" ^
"([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).Sid.AccountDomainSid.Value"') DO (
SET "USER_SID=%%~A"
)
ECHO USER_SID is set to %USER_SID%
There are many other things that can be accessed in this way.
powershell -NoLogo -NoProfile -Command ^
"Add-Type -AssemblyName System.DirectoryServices.AccountManagement;" ^
"[System.DirectoryServices.AccountManagement.UserPrincipal]::Current |" ^
"Format-List * -Force"
As you've raised a question, and in it decided to post some code, I'll offer a quicker and more simple alternative, regardless of whether you decide to post yours as a solution:
From cmd:
For /F Tokens^=3^ Delims^=^" %G In ('%SystemRoot%\System32\whoami.exe /User /Fo CSV /NH') Do #Echo %G
From a batch-file:
#For /F Tokens^=3^ Delims^=^" %%G In ('%SystemRoot%\System32\whoami.exe /User /Fo CSV /NH') Do #Echo %%G
Is it possible to create notification that lets you know if something was modified, created, etc?
#echo off
setlocal EnableDelayedExpansion
set "emailUserName="
set "emailPassword="
set "target="
REM set "target="
REM set "target="
set "subject="
FOR %%G IN (*) DO attrib -A "%%G"
:loop
set "body="
FOR %%G IN (*) DO (
attrib "%%G" | findstr /B /L A 1>nul
if !errorlevel! equ 0 (
echo "%%G"
set "body=!body!^<br ^/^>%%G"
attrib -A "%%G"
)
) 2>nul
if not "%body%"=="" echo sending email
if not "%body%"=="" set "body=!body!"
if not "%body%"=="" powershell.exe -command "Send-MailMessage -From '!emailUserName!' -to '!target!' -Subject '!subject!' -Body '!body!' -BodyAsHtml -SmtpServer 'smtp.gmail.com' -port '587' -UseSsl -Credential (New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ('!emailUserName!', (ConvertTo-SecureString -String '!emailPassword!' -AsPlainText -Force)))"
cls
goto :loop
emailUserName - from which email it will be send
emailPassword - enter password
target - to whom it will be sent
subject - subject
You need to create bash script and run it at the folder where files will be created/modified. As soon as file has been create or modified it will send an email to your target.
For simple notifications, you can use Directory Change Notifications. There's already a quite big and comprehensive example on the page and I will not write another example.
By simple notification I mean file/folder create and modification for a specific folder which shouldn't change very often.
If you want to handle system wide file/folder notification, I would suggest you to write a file filter driver.
In my opinion SharePoint 2016, 2013, or 2010 fixes your problem :
https://support.office.com/en-us/article/create-an-alert-to-get-notified-when-a-file-or-folder-changes-in-sharepoint-e5a79e7b-a146-46da-a9ef-d65409ba8918
I am writing a batch file and I need to start chrome exe using that batch file . So for that I need to get the path of the directory where chrome is installed .
Usually it is installed in " C:\Program Files (x86)\Google\Chrome\Application" but some users change the path while they install chrome.
I will like to get the path of that chrome exe on run time using command prompt and start it from there.
The content of my batch file are : Where for the highlighted code I want to get on run time instead of hard coding it into my .bat file
(I took help of this to get admin rights.)
#echo
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:----------------------https://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file----------------
echo Closing all instances of chrome.....
taskkill /f /im chrome.exe
echo All instances of chrome closed. Now going to chrome exe location
cd **C:\Program Files (x86)\Google\Chrome\Application**
echo Reached to chrome exe location. Ready to start new chrome with web security off.
chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security
Get the installed location of Google Chrome from the registry
"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Google Chrome\shell\open\command"
"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\StartMenuInternet\Google Chrome\shell\open\command"
Example:
set "Command="
for /f "tokens=2,*" %%A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Google Chrome\shell\open\command" /ve 2^>nul') do set "Command=%%~B"
if not defined Command for /f "tokens=2,*" %%A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\StartMenuInternet\Google Chrome\shell\open\command" /ve 2^>nul') do set "Command=%%~B"
if not defined Command echo Google Chrome was not found.
if defined Command start "Browser" "%Command%"
QuickEdit mode can be useful if you wish to quickly highlight and copy text directly from the command prompt instead of redirecting output to a file. However, it has its drawbacks. If you have a batch script running, selecting text in the console will pause the script execution until the text is deselected. This can be a problem if the script is expected to continue without pause.
How can one disable QuickEdit mode for certain BATCH scripts?
A way that will affect the current command prompt session.
Here's quickEdit.bat . It is a self-compiled .net script so it requires .net installed (not installed by default on Winsows XP/2003).
Usage:
Enable:
quickEdit 1
Disable:
quickEdit 2
Get State:
quickEdit 3
Already answered here, update "QuickMode" setting in Windows Registry:
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f
However it will not affect currently opened window. But you can reopen a window:
:: Get QuickEdit Mode setting from Windows Registry
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKCU\Console" /v QuickEdit`) DO (
set quickEditSetting=%%A %%B
)
if %quickEditSetting%==0x1 (
:: Disable QuickEdit Mode
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f
:: Open script in a new Command Prompt window
start "" "%~dpnx0" %* && exit
)
... script logic here ...
exit
Additional info about HKEY_CURRENT_USER\Console Registry configuration - https://renenyffenegger.ch/notes/Windows/registry/tree/HKEY_CURRENT_USER/console/index
Unfortunately, there is no way to edit the QuickEdit setting of the current CMD Console instance from command line. We can, however, temporarily disable the global QuickEdit setting and start a new console instance. There are a couple ways to do this, each with its own perks (pros) and drawbacks (cons). Both of the following solutions require the ability to modify the registry.
REGEDIT
PRO: Compatible with any common Windows system
CON: Requires the creation of temporary REG files
Code (goes at the beginning of your script):
if exist "%TEMP%\consoleSettingsBackup.reg" regedit /S "%TEMP%\consoleSettingsBackup.reg"&DEL /F /Q "%TEMP%\consoleSettingsBackup.reg"&goto :mainstart
regedit /S /e "%TEMP%\consoleSettingsBackup.reg" "HKEY_CURRENT_USER\Console"
echo REGEDIT4>"%TEMP%\disablequickedit.reg"
echo [HKEY_CURRENT_USER\Console]>>"%TEMP%\disablequickedit.reg"
(echo "QuickEdit"=dword:00000000)>>"%TEMP%\disablequickedit.reg"
regedit /S "%TEMP%\disablequickedit.reg"
DEL /F /Q "%TEMP%\disablequickedit.reg"
start "" "cmd" /c "%~dpnx0"&exit
:mainstart
REG
PRO: Does not require creation of temp files
CON: Not available on Windows 2000 and earlier without Resource Kit
CON: Different versions have different syntax (accounted for in code below)
Code (goes at the beginning of your script):
set reg50=::&set reg51=::&(reg /?>nul 2>&1 && set reg51=)
if %errorlevel%==5005 set reg50=
set qkey=HKEY_CURRENT_USER\Console&set qprop=QuickEdit
%reg51%if defined qedit_val (echo y|reg add "%qkey%" /v "%qprop%" /t REG_DWORD /d %qedit_val%&goto :mainstart)
%reg50%if defined qedit_val (reg update "%qkey%\%qprop%"=%qedit_val%&goto :mainstart)
%reg51%for /f "tokens=3*" %%i in ('reg query "%qkey%" /v "%qprop%" ^| FINDSTR /I "%qprop%"') DO set qedit_val=%%i
%reg50%for /f "tokens=3*" %%i in ('reg query "%qkey%\%qprop%"') DO set qedit_val=%%i
if "%qedit_val%"=="0" goto :mainstart
if "%qedit_val%"=="0x0" goto :mainstart
%reg51%echo y|reg add "%qkey%" /v "%qprop%" /t REG_DWORD /d 0
%reg50%if "%qedit_val%"=="" reg add "%qkey%\%qprop%"=0 REG_DWORD
%reg50%if "%qedit_val%"=="1" reg update "%qkey%\%qprop%"=0
start "" "cmd" /c set qedit_val=%qedit_val% ^& call "%~dpnx0"&exit
:mainstart
If you have another solution, feel free to post.
Slight update for option 1 that worked for me, that doesn't run it twice, on Win10, thanks.
if exist "c:\temp\consoleSettingsBackup.reg" regedit /S "c:\temp\consoleSettingsBackup.reg" & DEL /F /Q "c:\temp\consoleSettingsBackup.reg" & goto START
regedit /S /e "c:\temp\consoleSettingsBackup.reg" "HKEY_CURRENT_USER\Console"
reg add "HKCU\Console" /v QuickEdit /t REG_DWORD /d 0 /f
start "" "cmd" /c ""%~dpnx0" & exit"
exit
: START
rem your commands\scripts here
exit
quickedit.bat
::: TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAAClmdnY4fi3i+H4t4vh+LeL4fi2i+T4t4si9+qL4vi3i7Xbh4vg+LeLUmljaOH4t4sAAAAAAAAAAAAAAAAAAAAAUEUAAEwBAQBvnfBjAAAAAAAAAADgAA8BCwEGAAACAAAAAAAAAAAAABgQAAAAEAAAACAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAAAAAIAAAAAAAADAAAAAAAQAAAQAAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAABUEQAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAudGV4dAAAAPQBAAAAEAAAAAIAAAACAAAAAAAAAAAAAAAAAAAgAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACmEQAAshEAAMQRAADWEQAAlBEAAAAAAABVi+yD7AxTVos1DBBAAGr2/9aL2IXbD4T6AAAAg/v/D4TxAAAAjUX4UFP/FQgQQACFwA+E3gAAAP8VBBBAAIXAdH+KCITJdHmA+SJ1FUCKCITJdG1AgPkidGGKCITJdfTrWYD5IHRUgPkJdE9AigiEyXXv60aA+TB0doD5T3QFgPlvdRqKUAGA+kZ0BYD6ZnUNilACgPpGdFeA+mZ0UoD5MXRWgPlPdAWA+W91DYpIAYD5TnREgPludD9AigiEyXW0i134g2X0AMHrBoPjAWoAisMEMIhF/41F9FCNRf9qAVBq9f/WUP8VABBAAIvD60iLRfgkvwyA6wWLRfgMwDlF+HQPUFP/FRAQQAD32BvAQOsmM8DrIoNl9ACNRfRqAFCNRf9qAVBq9cZF/y//1lD/FQAQQACDyP9eW8nDfBEAAAAAAAAAAAAA5hEAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKYRAACyEQAAxBEAANYRAACUEQAAAAAAAP0CU2V0Q29uc29sZU1vZGUAAKQDV3JpdGVGaWxlABABR2V0Q29tbWFuZExpbmVBADMBR2V0Q29uc29sZU1vZGUAALkBR2V0U3RkSGFuZGxlAABLRVJORUwzMi5kbGwAAAAAAAAAAAAAAAAAAA==
#setlocal disabledelayedexpansion enableextensions
#echo off
if not exist quickedit.exe (
>quickedit.b64 (
for /f "delims=: tokens=1" %%# in ('findstr "^:::" "%~f0"') do echo %%#
)
certutil -f -decode quickedit.b64 quickedit.exe >nul
del /f /q quickedit.b64
)
quickedit.exe %*
on: quickedit 1
off: quickedit 0