Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Calling Custom Batcjh File

  • 25-12-2011 10:14PM
    #1
    Registered Users, Registered Users 2 Posts: 3,816 ✭✭✭


    Hey,

    I got a batch file off the internet a good few years ago that allowed me to quickly open applications or folders. Basically, I add a shortcut to the application or folder in another folder, which also contains a batch file, named m in this case. Then, my simply pressing win+R and for example typing "m c" it would call the batch file which would open the shortcut called c (chrome for example). It was a very handy script.

    Anyway, I have the script, I just can't recall how to add it to windows so that it calls the batch file when I type m into the run command. I tried adding it to the Path variable in environmental variables, but it just says Access Denied.

    Do you know where I would need to set this? Thanks.

    For anybody interested, this is the batch file.
    @echo off
    if "%1" == "" goto error
    :again
    if "%1" == "" goto end
    start %1
    shift
    goto again
    :error
    :end
    exit
    


Comments

  • Registered Users, Registered Users 2 Posts: 1,731 ✭✭✭GreenWolfe


    I put a batch files folder in my Document folder, added the path of that folder (C:\Users\UserName\Documents\BatchFiles) to my system PATH and I got your file and an example (p.bat for Notepad++) running fine.

    Unless you've got an admin account and the batch shortcuts are somewhere in your user documents I don't think this will work. The command prompt window only gets pulled down if you execute the file from C:\Users\......BatchFiles though.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 96,078 Mod ✭✭✭✭Capt'n Midnight


    control panel
    system
    advanced system settings
    (advanced tab in system properties)
    enviroment variables


Advertisement