en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en nl en en en en en en en en en de en en en en en nl en en en en en en en en en en en en en en en nl en en en en en en en en en fr en da en en en en en en en nl en en en en en en en en en en en en en en nl en en en en en pl en en de en en en en nl en en en en en en en en en en en pt en en en en nl vi en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en sl en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in Source Code Library only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
A little utility to shell to the command prompt
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
I wish I had thought of this a long time ago. I have the need to quickly go to the command prompt in a particular folder to do some DOS tasks.
The following is a little program that can be placed in a particular folder and run from an icon on the desktop. Maybe this has been done before or is too elementary, but here you go...
Gary Peek, Industrologic, Inc.
Join Date: Sep 1999
22 Oct 2008, 04:22 PM
I have a similar utility that will open up a command window in the specified folder without the need to put a program in that folder.
You put the utility in the SENT TO folder and when you right click you can select the utility from the right click popup menu. You can right click on a file or folder in Windows Explorer and open the command window. You can also right click on a short cut and it will take the working folder from the short cut and open the command window there.
If anybody has any interest search the source code forum for "Jump2DOS".
Mark Strickland, CISSP, CEH
Join Date: Aug 1998
26 Oct 2008, 05:50 PM
From a newsgroup Sept 2001:
> Most people use TWEAKUI, but you can add this feature via Explorer's,
> View>Options>File_Types, then move down the list to "Folder", press "Edit"
> then "New". Now in the action field type "Command Prompt Here" and in the
> field below it type "command.com /k cd" and press "OK".
Port Washington WI USA
Join Date: Nov 1998
26 Oct 2008, 10:25 PM
Just to round off methods, an alternate way which I use is to create a shortcut to CMD but delete the "Start in" path of %WINDIR% in the properties.
I use this often when workin on CC programs or PBWIN programs that require command line options.
Last edited by George Bleck; 26 Oct 2008, 10:28 PM.
Join Date: Dec 2003
27 Oct 2008, 05:47 AM
My Bad!! wrong forum. Please delete me.
Warped by the rain, Driven by the snow...
Join Date: Aug 2003
3 Dec 2008, 06:19 PM
One thing I do in addition to this is to assign a hot key to the prompt setup in one of the previous methods.
Then, when I need a dos prompt, I can hit alt-ctrl-\ and poof, instant dos prompt.
You can set this in the properties of the shortcut setup in one of the previous methods.
(though I wasn't aware of the /kcd parms, will have to try that one.
Join Date: Jul 2006
7 Dec 2008, 04:57 PM
Originally posted by Michael Mattias View Post
From a newsgroup Sept 2001:
> ... "command.com /k cd" ...
A comment on the "command.com /k cd" variant:
You will probably want to use "cmd.exe /k cd" instead, since that will invoke the win32 console which is more powerful in today's environment.
Command.com is the MS-DOS interpreter and is much less flexible - although for basic use the differences aren't too obvious. MS-DOS simulation was more important before, which probably explains why the sept 2001 newsgroup mention command.com. In addition, the "/k" switch isn't documented (checked against XP), but it works and behaves as prescribed.
Also, in this scenario - under XP - the "cd" part is superfluous, and a simple "cmd.exe /k" will do.
For good measure, you probably would want to have a as-fast-as-possible startup of cmd.exe and not spend time waiting for your system to search the path looking for cmd.exe, in which case you would want to duplicate the lead-in from your standard command prompt shortcut, which is something like "%SystemRoot%\system32\cmd.exe".
However, this approach will not resolve environment variables for you, so you will need to resolve it manually. In the end you should end up with something like: "C:\Windows\system32\cmd.exe /k" depending on the value of your %SystemRoot% variable (check it using the "SET  " command from within a console window).
The method under XP is also different from described above. Proceed as follows:
- Select Tools>Folder Options>File Types>File Folder
- In "Action" enter the text to be displayed in Explorer, e.g. "Console window"
- In "Application" enter your command "C:\Windows\system32\cmd.exe /k"
- Click "OK" and close all dialogs to return to the explorer main window.
- Right-click on a folder, select "Console window" and - voil√°! There it is!
BEWARE: Under XP this is a one-way thing only - you will not be able to edit nor remove it afterwards! One error here, and it's in there forever... unless you edit the registry directly, in which case you may enter, edit and remove this command as you wish. Four entries are necessary:
Create the following two keys:
modify the default name to whatever is the text you want to be displayed in Explorer, e.g. "Console Window". Don't enter the double quotes.
edit the default name to the command to be executed, e.g. "C:\Windows\system32\cmd.exe /k". Don't enter the double quotes.
As can be seen default registry values are all REG_SZ values, and REG_SZ values don't expand environment variables so you need to expand the command manually.
Final comment (something for PB staff?):
In my preview of this post, the key "HKEY_CLASSES_ROOT\Directory\shell\Console_window\command" was displayed with a space between "\c" and "om" yielding "\c ommand" both places until I enclosed the lines with CODE tags. I have not edited the lines themselves after inserting the CODE tags. In this final comment, the same string is displayed as "\ command" with a space between the last back-slash and "command". Time will show if this behaviour transfer into the live forum.
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 09:57 PM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.