Can this be made more efficient?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
taripo
Posts: 228
Joined: 01 Aug 2011 13:48

Can this be made more efficient?

#1 Post by taripo » 26 Nov 2011 00:53

I run this file when my cmd prompt starts up.

The problem is it takes a second or so longer for the prompt to appear because this is the time it has turned ECHO off and is creating all those doskey macros.

Is there any way to speed the process up?

the issue is not dependent on cdimprove.bat because that isn't called by auto.bat

I can't use Environment Variable style macros because the idea is W:<ENTER> goes to the W drive. I don't want to type %W:% or %$W:%

@echo off

doskey cd\=c:\cdimprove.bat \ % calling the bat for the change of prompt %
doskey cd..=c:\cdimprove.bat ..

doskey C:=c:\cdimprove.bat C:
doskey D:=c:\cdimprove.bat D:
doskey E:=c:\cdimprove.bat E:
doskey F:=c:\cdimprove.bat F:
doskey G:=c:\cdimprove.bat G:


doskey U:=c:\cdimprove.bat U:
doskey V:=c:\cdimprove.bat V:
doskey W:=c:\cdimprove.bat W:
doskey X:=c:\cdimprove.bat X:
doskey Y:=c:\cdimprove.bat Y:
doskey Z:=c:\cdimprove.bat Z:

doskey cd=c:\cdimprove.bat $*

doskey shortdirp=PROMPT $p$g
doskey longdirp=PROMPT $P$_$G
cd\

trebor68
Posts: 146
Joined: 01 Jul 2011 08:47

Re: Can this be made more efficient?

#2 Post by trebor68 » 26 Nov 2011 09:54

It is possible to run only one command DOSKEY.
I will hope that will have more speed.

Make a TXT file "DOSKEY_MACROS.TXT":

Code: Select all

cd\=c:\cdimprove.bat \ % calling the bat for the change of prompt %
cd..=c:\cdimprove.bat ..

C:=c:\cdimprove.bat C:
D:=c:\cdimprove.bat D:
E:=c:\cdimprove.bat E:
F:=c:\cdimprove.bat F:
G:=c:\cdimprove.bat G:

U:=c:\cdimprove.bat U:
V:=c:\cdimprove.bat V:
W:=c:\cdimprove.bat W:
X:=c:\cdimprove.bat X:
Y:=c:\cdimprove.bat Y:
Z:=c:\cdimprove.bat Z:

cd=c:\cdimprove.bat $*

shortdirp=PROMPT $p$g
longdirp=PROMPT $P$_$G


And now the batch file:

Code: Select all

@echo off
doskey /macrofile=DOSKEY_MACROS.TXT
cd\

taripo
Posts: 228
Joined: 01 Aug 2011 13:48

Re: Can this be made more efficient?

#3 Post by taripo » 26 Nov 2011 09:59

Runs instantly. Fantastic. Thanks..

no need to wait for the dos prompt to load up now!

Post Reply