Advertisement
FreeBooter

CopyToFolder

Aug 20th, 2022
1,125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.10 KB | Fixit | 0 0
  1. :: Add Copy To and Move to Context Menu
  2.  
  3.  
  4. @Echo Off
  5. Cls & Color 1A
  6.  
  7. REM  --> Check for permissions
  8. Reg query "HKU\S-1-5-19\Environment"
  9. REM --> If error flag set, we do not have admin.
  10. if %errorlevel% NEQ 0 (
  11. ECHO                 **************************************
  12. ECHO                  Running Admin shell... Please wait...
  13. ECHO                 **************************************
  14.  
  15.     goto UACPrompt
  16. ) else ( goto gotAdmin )
  17.  
  18. :UACPrompt
  19.     echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  20.     set params = "%*:"=""
  21.     echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
  22.  
  23.     "%temp%\getadmin.vbs"
  24.     del "%temp%\getadmin.vbs"
  25.     exit /B
  26.  
  27.  
  28. :gotAdmin
  29.  
  30. Cls & Mode CON  LINES=6 COLS=80 & Color 0E & Title Created By FreeBooter
  31. Echo.
  32. Echo.
  33. Echo        Add "Copy To..." and "Move To..." to Context Menu (A)  
  34. Echo.      
  35. Echo        Remove "Copy To..." and "Move To..." from Context Menu (R)
  36. Echo.
  37.  
  38.  
  39. Set /p input=^>
  40.  
  41. If /i  Not %input%==A (Goto :_Ex) Else (Goto :_Add)
  42.  
  43. :_Ex
  44. If /i Not %input%==R  (Goto :EOF) Else (Goto :_RegRestore)
  45.  
  46.  
  47.  
  48. :_Add
  49.  
  50. Reg.exe add "HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\CopyToFolder" /ve /t REG_SZ /d "{C2FBB630-2971-11d1-A18C-00C04FD75D13}" /f > Nul
  51. Reg.exe add "HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\MoveToFolder" /ve /t REG_SZ /d "{C2FBB631-2971-11D1-A18C-00C04FD75D13}" /f > Nul
  52.  
  53.  
  54. Cls & Mode CON  LINES=11 COLS=80 & Color 0E & Title Created By FreeBooter
  55. Echo.
  56. Echo.
  57. Echo.
  58. Echo.
  59. Echo           Adding "Copy To..." and "Move To..." to context menu  
  60. Echo.
  61. Echo.
  62. Echo.
  63. Ping -n 4 localhost >Nul
  64. Exit
  65.  
  66.  
  67. :_RegRestore
  68.  
  69. Reg.exe add "HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\CopyToFolder" /f > Nul
  70. Reg.exe add "HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\MoveToFolder" /f > Nul
  71.  
  72.  
  73. Cls & Mode CON  LINES=11 COLS=80 & Color 0D & Title Created By FreeBooter
  74. Echo.
  75. Echo.
  76. Echo.
  77. Echo.
  78. Echo           Removing "Copy To..." and "Move To..." from context menu    
  79. Echo.
  80. Echo.
  81. Echo.
  82. Ping -n 4 localhost >Nul
  83. Exit
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement