Avatar of LyonJay
LyonJay
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Calling a program from a bat script

Dear all,

I have a program under the following directory:

C:\Program Files\Windows Resource Kits\Tools\delprof.exe

Normally I have to navigate my command prompt to that folder to call the program.

Does anyone know how I can put this into a script?

I also have to put the following after the script delprof.exe /Q /I /D:30

Thanks,

Lyon
Windows OSMicrosoft Server OSWindows XP

Avatar of undefined
Last Comment
Steve Knight

8/22/2022 - Mon
RussPitcher

If it's a batch file or a PowerShell script simply call it as if you were typing it:

"C:\Program Files\Windows Resource Kits\Tools\delprof.exe" /Q /I /D:30

Open in new window


Don't forget to enclose any paths with spaces in quotes
dooet

add ";C:\Program Files\Windows Resource Kits\Tools" to the path (without quotes)
in System Proerties >> environment variables >> system variables
David Johnson, CD

or --- cmd.bat --->
set path = %path%;"c:\program files\windows resource kits\tools\";
delprof /q /i /d:30
<---

use in between the --> and <-- in your batch file
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Steve Knight

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.