Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to enter macro in autoexec.bat?

Status
Not open for further replies.

zacker7

Programmer
Jan 20, 2003
9
0
0
US
I have several DOS macros that work as intended, but this one, as entered in autoexec.bat, doesn't:

doskey ip=ipconfig/all | more

The macro works as if it were

doskey ip=ipconfig/all

What's wrong?

Thanks,

Zacker
 
Are you certain the the more.com file exists?

There's always a better way...
 
Yes, C:\WINDOWS\COMMAND\MORE.COM exists.

I should have added that

ipconfig/all | more

at the DOS prompt does just what I want. So why doesn't "more" work in the macro,

doskey ip=ipconfig/all | more

whether entered at the prompt (and then typing "ip"), or put into autoexec.bat?

Thanks again,

Zacker
 
why compicate things?
Make a bat file ip.bat and put in in a folder in your path (windows or so) with a shortcut on the desktop.
it will do exactly the same and more if you want to.

ip.bat

ipconfig/all | more
pause
exit

Marc
[sub]If 'something' 'somewhere' gives 'some' error, expect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC!
[/sub]
 
Error in my note of May 5. More sense (?) :
doskey ip=ipconfig/all$t | more
doskey ip=ipconfig/all | $tmore
$t may be used to separate commands in a macro with multiple commands.
 
The suggested ip.bat works fine, but I still would like a DOS macro.

Tried the suggested
doskey ip=ipconfig/all | $tmore
No go. Result is same as
doskey ip=ipconfig/all

Zacker
 
If I may ask, how would you use that?
I must be missing something as I don't see the benefit of your idea.
 
marcs41, please clarify. What/which idea?

Zacker
 
Well what exactly you want to do with entering it in autoexec as Doskey ?
How would you use that then?
 
marcs41, with
doskey ip=ipconfig/all
in autoexec.bat, I can enter just "ip" instead of "ipconfig/all" at the DOS prompt and get the output of ipconfig. The problem is the output is 2 screenfulls. If I could use "more", I could see one screen at a time of the output.

Here are some of the other macros I use:

doskey cp=CD C:\Python22doskey cptk=cd C:\Python22\Tkinterdoskey cps=cd C:\Python22\Scriptsdoskey c=cd c:doskey up cd ..
doskey up2 cd .. $T cd ..
doskey dt=deltree c:\windows\tempdoskey e=exit
doskey p=ping $1
doskey t=tracert $1
doskey py=ping yahoo.com
doskey ty=tracert yahoo.com
doskey put=ping doskey tut=tracert doskey pjls=ping doskey tjls=tracert doskey pa=ping doskey ta=tracert doskey pb=ping news.fu-berlin.de
doskey tb=tracert news.fu-berlin.de
doskey pl=ping doskey tl=tracert doskey pg=ping google.com
doskey tg=tracert google.com

Zacker
 
I just got the answer to my question from a newsgroup:

[bold]doskey ip=ipconfig /all $b more[/bold]

"doskey ip=ipconfig/all $b more" also works.

Zacker
 
Nice to post the solution to your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top