Sccm to run bat file shows up error bad environment

sccm

I have to run a bat file on client computer and collect data store on a shared folder. A shared path with files and bat file, configured the package in sccm. but does not work shows error as failed bad environment. Manually the bat file executes.
Content of bat file is simple.

@ECHO OFF
ECHO %0
Net use q: \\mfs01\Tool\Tool\Standalone /persistent:yes
cd..
q:
KPG_Tool_V1.vbe
@pause

Best Answer

Use pushd and popd to navigate to the paths you need. Something like

pushd \\mfs01\Tool\Tool\Standalone

cscript KPG_Tool_V1.vbe

popd
Related Topic