home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 42,040 of 42,547   
   Zaidy036 to All   
   Re: Change the right click context menu    
   03 Jul 22 20:42:34   
   
   XPost: alt.comp.os.windows-10   
   From: Eric@Bloch.com   
      
   On 7/3/2022 6:41 PM, JJ wrote:   
   > On Sun, 3 Jul 2022 08:40:49 -0600, John Robertson wrote:   
   >> Is there a way to change the right click context menu for Windows *.bat   
   >> batch files to limit the options to just those that I want there?   
   >>   
   >> I don't want open or open with.   
   >> I don't want print (as I can print from the editor)   
   >> I don't want Scan with Microsoft Defender...   
   >> I don't want share   
   >> I don't want Restore previous versions   
   >> I don't want send to   
   >>   
   >> All I do want is what I do with a batch file.   
   >> For example, I definitely want the "Run as administrator" item   
   >> And I only need "Edit" and not print (because I can print from the editor)   
   >> I'm ok with the "Send to" section (but which I never use)   
   >> I'm ok with the "cut & copy" section too   
   >> I'm ok with the "Create shortcut, deleted, and rename" section   
   >> And I'm ok with the "Properties" section   
   >>   
   >> That's it.   
   >> Is there a way to change the batch context menu to do just want I want it   
   >> to do? (Mostly just "Run as Administrator" and not much else.   
   >   
   > Yes, but you need to know that, all menu items are registered based on the   
   > file type, and those menu items are registered for a pseudo file type which   
   > represent all file types. Kind of like global menu items.   
   >   
   > To remove e.g. the Send To menu from bat file type, it has to be   
   > unregistered from the pseudo all-file-type, AND in order for it to be shown   
   > for all other file types, it has to be manually registered for EACH and   
   > every file type, including the pseudo file type which represent unknown file   
   > types. Meaning that if there are 200 known/registered file types in the   
   > system, the menu will need to be added onto the other 199 file types. Also,   
   > for EACH newly registered file type, the menu will need to be manually   
   > added.   
   >   
   > In short, yes. It's possible, but it would be a tedious task without the   
   > help of an automation script or program, and it will require additional   
   > effort to re-add the no-longer-global menu items for each new file type   
   > added into the system.   
   One way to always run as Admin would be to start the batch with:   
      
   If %1=a goto xxxx   
   SCHTASKS /RUN /TN    at highest privileges and add argument a.   
   :xxxx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca