TheAslan Posted May 19, 2013 Share Posted May 19, 2013 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\LocalLooks like registry does not allow shorten paths.For example here's what I tried: \%AppData%\Local\test.batBut that opens only documents folder... Link to comment Share on other sites More sharing options...
dim505 Posted May 20, 2013 Share Posted May 20, 2013 ohh boy thanks for reminding me im going to have fun with batch scripting maybe screw with my friends pc:troll: Link to comment Share on other sites More sharing options...
Phyton Posted May 20, 2013 Share Posted May 20, 2013 try /C "%ALLUSERSPROFILE%\AppData\Local\test.bat Link to comment Share on other sites More sharing options...
dcs18 Posted May 20, 2013 Share Posted May 20, 2013 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\LocalLooks like registry does not allow shorten paths.For example here's what I tried: \%AppData%\Local\test.batDid you try the following:-%LocalAppData%\test.bat Link to comment Share on other sites More sharing options...
TheAslan Posted May 20, 2013 Author Share Posted May 20, 2013 Not working. Link to comment Share on other sites More sharing options...
dcs18 Posted May 20, 2013 Share Posted May 20, 2013 Not working.What method are you using - it's working perfectly well, here:- Link to comment Share on other sites More sharing options...
TheAslan Posted May 20, 2013 Author Share Posted May 20, 2013 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 More sharing options...
dcs18 Posted May 20, 2013 Share Posted May 20, 2013 @="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 More sharing options...
TheAslan Posted May 20, 2013 Author Share Posted May 20, 2013 But I'm trying to do this without my username. That's why I started this topic. Link to comment Share on other sites More sharing options...
dcs18 Posted May 20, 2013 Share Posted May 20, 2013 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 More sharing options...
TheAslan Posted May 20, 2013 Author Share Posted May 20, 2013 I didn't test it because I want to find a way to to this without any username. Link to comment Share on other sites More sharing options...
dcs18 Posted May 20, 2013 Share Posted May 20, 2013 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 More sharing options...
ictkey Posted May 21, 2013 Share Posted May 21, 2013 @echo offstart C:\Users\#Username#\AppData\Local\test.batCopy to notepad and save as "AppData\Local.bat" in your desktop Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.