I want to run a batch file. Is there an easier way

M

Metspitzer

dir /B /O:N > mylist.txt

This bat is supposed to just put a list of the files into a text file.
The directory changes and the mylist.txt is only temporary. I cut and
paste the results into a larger list.

The way I run it now is to just open a command prompt and change to
the directory and type the batch name.

Is there a way to make this default to the current directory and
output to the current directory by using the run command instead?
 
R

Rasta Robert

dir /B /O:N > mylist.txt

This bat is supposed to just put a list of the files into a text file.
The directory changes and the mylist.txt is only temporary. I cut and
paste the results into a larger list.

The way I run it now is to just open a command prompt and change to
the directory and type the batch name.

Is there a way to make this default to the current directory and
output to the current directory by using the run command instead?

Microsoft Open Command Prompt Here Powertoy (Shell extention) does that:
<http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe>

This page describes several ways to add a shortcut to open a cmd window in
the current directory:
<http://www.petri.co.il/add_command_prompt_here_shortcut_to_windows_explorer.htm>
 
N

Nil

dir /B /O:N > mylist.txt

This bat is supposed to just put a list of the files into a text
file. The directory changes and the mylist.txt is only temporary.
I cut and paste the results into a larger list.

The way I run it now is to just open a command prompt and change
to the directory and type the batch name.

Is there a way to make this default to the current directory and
output to the current directory by using the run command instead?

If you mean the Run dialog box off the Start menu, the answer is No,
because how would it know what you consider to be "the current
directory"? You will always have to type in the path there.

You could have a batch file on the desktop (or a shortcut to it) and
drag-and-drop the folder in question onto it. This batch file will do
it:

======== cut here =========

dir %1 /b /on > %1\mylist.txt
 

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