Jump to content

How to open .bat file via Context Menu?


TheAslan

Recommended Posts

So, I want to create a registry key which will open a .bat file via Context Menu (Dektop only), and it needs to be extended (Shift needs to be pressed down to be able to see this entry in Context Menu).

But problem here is that this .bat file is located at C:\Users\#Username#\AppData\Local, that's why I'm asking that how I can modify that path so it would only show like Appdata\Local

Looks like registry does not allow shorten paths.

For example here's what I tried:

\%AppData%\Local\test.bat

But that opens only documents folder...

Link to comment
Share on other sites


  • Replies 12
  • Views 1.7k
  • Created
  • Last Reply
But problem here is that this .bat file is located at C:\Users\#Username#\AppData\Local, that's why I'm asking that how I can modify that path so it would only show like Appdata\Local

Looks like registry does not allow shorten paths.

For example here's what I tried:

\%AppData%\Local\test.bat

Did you try the following:-

%LocalAppData%\test.bat

Link to comment
Share on other sites


This is the only way works for now:

@="C:\\Windows\\explorer.exe \"C:\\Users\\Admin\\AppData\\Local\\test.bat\""

Link to comment
Share on other sites


@="C:\\Windows\\explorer.exe \"C:\\Users\\Admin\\AppData\\Local\\test.bat\""

Try whether the following one works - it's shorter:-

@="\"C:\\Users\\Admin\\AppData\\Local\\test.bat\""

Edit:

If Admin is not your Profile UserName - replace it with the correct one.

Link to comment
Share on other sites


Did it work?

But I'm trying to do this without my username. That's why I started this topic.

It can be accomplished without the UserName, too.

Link to comment
Share on other sites


I didn't test it because I want to find a way to to this without any username.

You're mentioning the UserName pre-condition pretty late in the day.

Link to comment
Share on other sites


@echo off

start C:\Users\#Username#\AppData\Local\test.bat

Copy to notepad and save as "AppData\Local.bat" in your desktop

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...