1.

Solve : Batch file don't run in open dos window?

Answer»

Hello when i run this batch file I am unable to get it to popupate a list of pst files on the dos window, just brings up a empty dos window.


echo off
CMD
DIR /a /s | find ".pst"


ALSO how do you get this command below to run in the Start -> RUN command line

DEL /f /s /q %temp%1.
echo off
dir /a /s /b *.pst

2.
DEL /f /s /q "%temp%"
Thanks for the help,

Worked!

1.

echo off
dir /a /s /b *.pst
pause

and

2.

Does not work in XP in the Start -> Run window.  ERROR Windows can not find DEL...

DEL /f /s /q "%temp%"

Quote from: wildmanjoe on JANUARY 22, 2012, 07:25:16 AM

Does not work in XP in the Start -> Run window.  Error Windows can not find DEL...

DEL /f /s /q "%temp%"

Sorry... I FORGOT it was the Run box...

cmd /c DEL /f /s /q "%temp%"Awesome! # 2 worked thanks again, last question i promise.

I also want to run this in start -> run

dir /a /s /b *.pst

I did:  CMD /c dir /a /s /b *.pst

But i am unable to figure out how to get it to pause after it generates a list of the PST files, the dos screen flashes and goes away quick. Noticed the pause command is for batch only and I am unable to locate the  " / a b c d e f " commands list anywhere on the net and find pause.

SOURCEhttp://technet.microsoft.com/en-us/library/bb490965.aspx Quote from: wildmanjoe on January 22, 2012, 09:23:35 AM

I did:  CMD /c dir /a /s /b *.pst

But i am unable to figure out how to get it to pause after it generates a list of the PST files


(Please ignore the post above)

I am showing some screen grabs this time... hope you can see them... this is what I typed... as you can see pause is not just for use in scripts.

Code: [Select]CMD /c dir /a /s /b *.pst & pause


You could also use the /K switch with the cmd processor.

cmd /k dir /a-d /s /b *.pst Quote from: Squashman on January 22, 2012, 02:57:05 PM
You could also use the /K switch with the cmd processo.

cmd /k dir /a-d /s /b *.pst

yes, you are right. I thought of this after I posted but you have beaten me...

If you use /k then the there is no need for a pause because the command window will not close. This is better.


Nice! WOW, I was using the K at the end and it was asking me Y/N to run stuff so i didn't go thhat route, thanks again!


Discussion

No Comment Found