Hi,
Thank you for posting in Microsoft Q&A forum.
Yes, you can place your .bat script in a folder, create a package pointing to this folder, create a program that runs the script, and deploy. Follow the steps below to deploy the batch file onto systems as you create for standard package.
Step 1) Place the batch file onto a folder (shared folder)
Step 2) Create a package and select the above folder as source files
step 3) create a new program with command line batch filename.bat with proper settings as per the need.
step 4) create an advertisement by selecting the above created package and program to required collection.
Similar threads for your reference:
How do I push a batch file using SCCM
Running a batch file through SCCM
The .bat script looks like below:
@echo off
set uninstallerPath=C:\Program Files (x86)\Notepad++\uninstall.exe
if exist "%uninstallerPath%" (
echo Uninstalling Notepad++...
"%uninstallerPath%" /S
timeout /t 5 > nul
if not exist "%uninstallerPath%" (
echo Notepad++ uninstalled.
) else (
echo Notepad++ uninstall returned %errorlevel%
)
) else (
echo Notepad++ uninstaller not found.
)
Thanks for your time. Have a nice day!
Best regards,
Simon
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.