NotNull wrote: ↑Sun Jan 26, 2020 6:02 pm
Ah, that explains it! That will work
So, everything (and "Everything") OK now and I can uninstall gvim again?
(Nothing wrong with your English, btw)
P.S. And don't forget these registry keys, as they overrule what you defined in your script:
Code: Select all
set "EXT=.txt"
:: Part 1
reg.exe query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\%EXT%\UserChoice" /v ProgID
:: Part 2 (where PART 1 links to)
for /f "usebackq tokens=2,*" %x in (`reg.exe query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\%EXT%\UserChoice" /v ProgID`) do reg.exe query "HKCR\%y" /s
(
I think I don't need to tell you, but ...
If you want to run this from a script (instead of a command-line) double the % in %x and %y : %%x and %%y
)
COOL!
I finally understand how to double-click open the program with registry modification. As you said!
Modifying the key value of "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice\Progid" is "txtfile" !(If it is not using ps1, it needs to modify the permissions.)
And content menu changes default program this step can be removed!
Thanks for the code and experience, Ps1 scripts use for loop to modify the registry is really elegant and simple!
vim is very powerful and recently tried vscode, it is very convenient, comes with perfect coding features, but can not replace vim.
BTW, What editor do you usually use?
![Shocked :shock:](./images/smilies/icon_eek.gif)