How to open CmdPrompt and write but NOT execute command to it ? Registry entry for cmd.exe history b

K

Ken Williams

Ok, I could setup a ShortCut to open a CmdPrompt and pass a command and automatically
execute it with the following instruction:

cmd.exe /k cd "%1"

But what if I want to write the command only into the current line of the opened CmDPrompt but don't want
to let it execute automatically? I want e.g. the user to give the possibility to change a switch of the command.

Is there a way to code this non-automatic command-passing?

Maybe there is a workaround like storing some commands in the history buffer of the current Cmdprompt
so that the user needs only the pree the PageUp button to get this command string?

In which registry key is the command history buffer stored?

Ken
 
P

Pegasus \(MVP\)

Ken Williams said:
Ok, I could setup a ShortCut to open a CmdPrompt and pass a command and automatically
execute it with the following instruction:

cmd.exe /k cd "%1"

But what if I want to write the command only into the current line of the
opened CmDPrompt but don't want
to let it execute automatically? I want e.g. the user to give the
possibility to change a switch of the command.
Is there a way to code this non-automatic command-passing?

Maybe there is a workaround like storing some commands in the history
buffer of the current Cmdprompt
so that the user needs only the pree the PageUp button to get this command string?

In which registry key is the command history buffer stored?

Ken

How about just opening a Command Prompt by typing nothing other than
"cmd" in the run box?
 
B

billious

Ken Williams said:
Ok, I could setup a ShortCut to open a CmdPrompt and pass a command and
automatically
execute it with the following instruction:

cmd.exe /k cd "%1"

But what if I want to write the command only into the current line of the
opened CmDPrompt but don't want
to let it execute automatically? I want e.g. the user to give the
possibility to change a switch of the command.

Is there a way to code this non-automatic command-passing?

Maybe there is a workaround like storing some commands in the history
buffer of the current Cmdprompt
so that the user needs only the pree the PageUp button to get this command
string?

In which registry key is the command history buffer stored?

Ken

How about setting up a batch file along the following lines:

@echo off
set varname=%1
set /p varname=Replace %1 with ?
cd "%varname%"

The environment variable varname takes the entered string or remains
unchanged (ie = %1) if the user responds with the ENTER key alone.

Batch techniques for NT/2K/XP discussed in alt.msdos.batch.nt

HTH

....Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top