• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

Sign in to follow this  

Some Basic Command Prompt Help

Recommended Posts

Sir Topham Hatt    270

Hello

 

Sorry if my terminology isn't quite right here.

 

I have a utility that I need to run through command prompt.

It's located in F:\somefolder\

 

Is there a way I can create a shortcut that will always open the cmd at location F:\somefolder\ ready for me to type what I need to?

Share this post


Link to post
Share on other sites
xendrome    5,418
Posted (edited)
2 minutes ago, Sir Topham Hatt said:

Hello

 

Sorry if my terminology isn't quite right here.

 

I have a utility that I need to run through command prompt.

It's located in F:\somefolder\

 

Is there a way I can create a shortcut that will always open the cmd at location F:\somefolder\ ready for me to type what I need to?

cmd /K "cd F:\somefolder\"

 

Make a shortcut to that

  • Like 1

Share this post


Link to post
Share on other sites
Brandon H    2,913

you could create a .bat file with the following

 

@echo off

F:

cd "F:\somefolder"

start "" "app.exe"

exit

 

doing just F: will change the working drive of the file and then CD will take it to whatever folder you need :)

 

edit: or do you mean you just need the cmd window to open pointed to that location? that can be accomplished similarly

 

@echo off

F:

cd "F:\somefolder"

cmd

This will open the cmd prompt to that folder

  • Like 1

Share this post


Link to post
Share on other sites
Sir Topham Hatt    270

Thanks both.

I'll give these a go.

 

Discovered the delights of a media downloading program that runs in a CMD window.

 

Although have also found a nice GUI for it...

Share this post


Link to post
Share on other sites
Richard C.    288

If you add the folder into the PATH variable, you can just type the name of the app from anywhere without making batch files or anything.

 

before

c:\somefolder\someapp.exe

 

adding c:\somefolder\ to PATH

"someapp.exe"

 

 

path.png

Share this post


Link to post
Share on other sites
+BudMan    3,514

you know if you put that folder in your path, you don't need to be in that folder when you run that command you could be in any folder.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.