Question:
i have to run a program in DOS from XP. How do I make it so it opens in in the folder i am using?
entropic v
2008-02-01 08:12:01 UTC
So When I run the command prompt it looks like this:
c:\Documents and Settings\my.name>
I then have to cd command to desktop\folder a
But it is a pain since I have to cd from the beginning (Docs and Settings)
Can I run the command prompt with it starting right at folder a?
Four answers:
limaxray
2008-02-01 08:28:23 UTC
First, I just want to point out that this is not DOS, it is simply a Windows XP command prompt, and DOS hasn't been part of Windows since ME.



Anyway, I may not fully understand what you are trying to do. Are you trying to change to a directory on your desktop while already being in your user directory?



just do this:



cd Desktop\folder



You don't need to include the entire path, just the relative path. Also, you should note that if you enter a few letters of the directory or file you're typing out and then press Tab it will fill in the rest of the word. So try it; open up a command prompt, then type 'cd d' and hit Tab, and you'll see it fills in the rest of the word. If there is more than one directory that starts with 'd' you can press Tab repeatedly to cycle through all your options. Once you get the Desktop directory filled in, add a backslash and the first letter of the next directory and repeat. It might seem a little confusing at first, but once you get the hang of it, it makes using a command prompt much easier.
jpschnei
2008-02-01 16:50:27 UTC
I'm not 100% sure I understand your question. If you're trying to bring up a command prompt so that it starts in a folder on your desktop (we'll call it "TheFolder"), one way to do it is to create a shortcut on the desktop you can just click on. To do that:



Right click on an empty area of your desktop. You'll get a context menu with a bunch of choices. The one you want is labeled "New" with an arrow on the right hand side. When you move your mouse over the "New" selection, you'll get another menu. The selection you want is near the top, labeled "Shortcut". Click that.



This will bring up the "Create Shortcut" wizard. The first dialog will ask for the location of the program you want to run. Just type "cmd" in the text box, and click the "Next >" button.



The next dialog box will ask for a name for your new shortcut (it will default to "cmd.exe" - you can change it to just about anything you want; pick something you'll easily remember later). Once you've named your new shortcut, click the "Finish" button.



Now, right click on the shortcut you just created (it should look like a little command window) and select "Properties" from the menu that pops up. You'll get a tabbed dialog box - select the "General" tab.



The "General" tab contains general information about the shortcut - the piece you want is the "Location:" (for example, with my test shortcut, it's "C:\Documents and Settings\Jim\Desktop"). Select that with your mouse and press -C to copy it to the clip board.



Go to the top of the dialog box and click the "Shortcut" tab. In the textbox that's labelled "Start in:", select the text (which will probably be "%windir%") and press -V to replace it. Your cursor should be at the end of the text you just pasted in.



Type a backslash character and the name of the folder on your desktop where you want it go (for example, my test shortcut now has "C:\Documents and Settings\Jim\Desktop\TheFolder"). Windows will probably give you a selection list to choose from once you type in the backslash character - you can scroll down until you're at the entry you want.



Once you've entered the folder name, check to make sure it's where you want to go, and that you didn't leave part of the old folder name in the text box. Then, click "Apply" and "OK" at the bottom of the dialog box. Test it out by clicking on your new shortcut. You should get a command prompt with the directory you want (my example opened in "C:\Documents and Settings\Jim\Desktop\TheFolder")



If you just want to run a DOS program and be sure it's running in the correct directory, that's a lot easier - start by pulling up the "Create Shortcut" dialog, then click on the "Browse..." button. Find the program you want (for example, if you're trying to start "TheProgram.exe" in "TheFolder" from your desktop, select "TheFolder" from the browse dialog, then select "TheProgram.exe") and click "OK" in the browse dialog. Then, click "Next >" in the "Create Shortcut" wizard. Again, you'll be presented with a dialog to let you name the shortcut.



If the program is truly a DOS program, the button at the bottom of the naming dialog will be "Next >", rather than "Finish". Click it, and you'll be presented with a selection of icons to use for the shortcut. Pick one, and click "Finish". If it's a Windows program, you'll just have the "Finish" button at the bottom.



In either case, once you've created the shortcut, you can use it to start the program, and the program will start in the directory where you found it. If you want to change the starting directory, you'll need to right-click on the icon and pick "Properties". For a Windows program shortcut, you'll change it in the "Start in:" text box of the "Shortcut" tab. For a DOS program shortcut, it's the "Working:" text box of the "Program" tab.



If you're trying to run a DOS program that doesn't work very well from Windows, you can either try tuning the startup parameters in a shortcut for that program, or you can install DOSBox (a free program that runs DOS programs in a virtual machine) and run it there. Either of these is way more complicated than you'll want to do on your own, so if you need something like this, find your friendly neighborhood geek, and sweet-talk them into doing it for you.



Good luck, and let me know how that works out for you.
kicking__it
2008-02-01 16:22:59 UTC
1) Create a Shortcut for CMD (located in C:\Windows\System32)

2) Right-click on the shortcut created.

3) Edit the start-in location to C:\
Hmmmm
2008-02-01 16:18:42 UTC
answer


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...