JetBrainsTrial.bat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
:: This bat file can be used to renew Resharper C# and Resharper C++ every time it runs out
:: It most likely works for all Jetbrains tools, however, I did not test this.
:: I was not able to find the original author for the reg key and the folders that needs to be deleted so if that is you feel free to reach out for credit
@ echo
off
setlocal
enableDelayedExpansion
: confirm
echo Did you stop all Jetbrains services?
echo Jetbrains toolbox AND any other tool using it such as Rider, Visual Studio, ...
set /p " (Y/YES): "
set
" !userInput:~ 0 , 1 ! "
&
set
" !userInput:~ 0 , 1 !%userInput:~ 1 % ! "
set
" !userInput:~ 0 , 1 !%userInput:~ 1 % "
&
set
" !userInput:~ 0 , 1 !%userInput:~ 1 % "
for
%%a
in (y yes) do
( if /i " !userInput! " %%a "
( echo Continuing...
goto continue
)
)
echo Please make sure that all services are stopped, otherwise it may not work.
goto confirm
: continue
REM Delete eval folder with licence key and options.xml which contains a reference to it
for
%%I
in ( " WebStorm " , " IntelliJ " , " CLion " , " Rider " , " GoLand " , " PhpStorm " , " Resharper " , " PyCharm " ) do
( for /d %%a
in ( " %USERPROFILE% . %%I * " ) do
( rd /s /q " %%a /config/eval "
del /q " %%a \config\options\other.xml "
)
)
reg delete " HKEY_CURRENT_USER\Software\JavaSoft " /f
REM Change device identifiers
set
" "
set
" 12 "
set
" 0123456789ABCDEF "
set
" #
"
set
" %appdata% \JetBrains\PermanentPackageCheckerId "
set
" %appdata% \JetBrains\PermanentDeviceId "
set
" %appdata% \JetBrains\PermanentUserId "
set
0
: loop
if
defined inputFile[ %i%
] ( set
!inputFile[%i%]! set
" !file! .tmp "
for /f " delims= "
%%a
in ( !file! ) do
( set
" %%a "
:: Find the last occurrence of the character
for /l %%i
in (0,1,1023) do
( set
" %%i "
if
" !line:~ %%i ! " "
goto
replace
if
" !line:~ %%i , 1 ! " %char% "
set
" %%i "
)
:
replace
set
" !line:~ 0 ,%lastPos%! "
call : random
set
" !beforeChar!!char!!hex! "
echo
!newLine!
" %tempFile% "
)
move /Y " %tempFile% "
" !file! "
nul
echo Fixed !file!
set /a i += 1
goto : loop
) goto : exit
: random
set
" "
for /l %%i
in (1,1, %len% ) do
( for /f " tokens=* "
%%n
in ('powershell -NoLogo -NoProfile -Command Get-Random -Minimum -0 -Maximum 15') do
set
" %%~n "
call
set
" !hex! %%c hars:~ !rnd! ,1 %% "
) exit /b
: exit