Link to home
Start Free TrialLog in
Avatar of LyonJay
LyonJayFlag 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
Avatar of RussPitcher
RussPitcher
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of dooet
dooet

add ";C:\Program Files\Windows Resource Kits\Tools" to the path (without quotes)
in System Proerties >> environment variables >> system variables
Avatar of 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
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial