You are here

CommandPromptPortable Request

6 posts / 0 new
Last post
Shawn Faucher
Shawn Faucher's picture
Offline
Last seen: 13 years 5 months ago
Developer
Joined: 2007-10-23 22:14
CommandPromptPortable Request

I have a request for when CommandPromptPortable is brought up to date. Currently it is impossible to enter additional parameters via ini or command line, only by using commandprompt.bat in Data\batch. This makes it difficult to use CommandPromptPortable from other Portable Apps. For instance with Perl Portable I want to be able to open up a command prompt with a /k parameter to perform a command or custom batch file. As it stands to do this I have to back up any existing commandprompt.bat and create my own temporary one, then swap them back out afterward.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 36 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Directly

Probably easiest to just call cmd.exe directly in that case. Command Prompt Portable was made to make it easy to have a single command prompt icon in your menu that works on Windows 9x and Windows 2K+ with the ability to make some simple customizations (font, prompt, window title, etc). Not sure why any of that would be advantageous to a Perl Portable install. Maybe I'm missing something, though... How would it be an advantage over just calling the local cmd?

Sometimes, the impossible can become possible, if you're awesome!

Shawn Faucher
Shawn Faucher's picture
Offline
Last seen: 13 years 5 months ago
Developer
Joined: 2007-10-23 22:14
All right..

I guess I assumed Command Prompt Portable was a first effort and it might become a little more flexible in the future. I'll go ahead and skip it and check for Console Portable or use COMSPEC directly.

The reason I need to do this in Perl Portable is to provide a shell with the correct environment for running CPAN. I can do the ENV variables in the launcher but I want to run a custom batch to echo brief instructions etc.

formerly rayven01

mjcarman
Offline
Last seen: 12 years 1 week ago
Joined: 2006-07-27 17:05
Consistency

The reason to go through Command Prompt Portable is to create a consistent interface for end users. If I've customized my CPP settings I'd like to keep them in a shell opened for Perl Portable. e.g. I modified my CPP batch file to add a tools directory (some gnuwin32 goodies) to my PATH. I'd like to have those available in all portable command shells.

Shawn Faucher
Shawn Faucher's picture
Offline
Last seen: 13 years 5 months ago
Developer
Joined: 2007-10-23 22:14
Good point

Unfortunately the way it's currently written there's really no reliable way to do what I need with Command Prompt Portable without replacing commandprompt.bat, which would not get you your settings.

Fortunately Perl Portable will have an autorun.bat in Settings where you could easily add the same settings you have in commandprompt.bat.

formerly rayven01

rab040ma
Offline
Last seen: 6 months 2 days ago
Joined: 2007-08-27 13:35
You could have several .bat

You could have several .bat (.cmd) files that set up your shell exactly the way you want it -- with only a few exceptions, such as settings that only get saved in the registry that aren't options for CPP at present.

This would be an extra step, but once you have CommandPromptPortable open, you could run your PerlPortable.cmd to set up a shell with Path and current directory and other settings just for Perl. You could even do something like modify the CommandPrompt.bat to look for a PerlPortable.cmd in a certain location and run it when it is found, and have PerlPortable create the special .bat file when needed and delete it afterwards.

Another option would be to have your PerlPortable open a command prompt in the same way that CommandPromptPortable does, only calling a special bat/cmd file for specific purposes.

MC

Log in or register to post comments