2

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
Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
Venky
  • 31
  • 1
  • 4
  • I would focus less on the content of the bat file and more on the properties of the sccm package/application. Bad Environment is afaik an error you get before that bat file is even executed. Are you running this as a user or with admin rights? As admin it would be executed with system account which by default has no right to read a shared (network) path (it can be granted the right though). – Syberdoor Mar 14 '19 at 15:52

2 Answers2

0

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

pushd \\mfs01\Tool\Tool\Standalone

cscript KPG_Tool_V1.vbe

popd
duenni
  • 2,959
  • 1
  • 23
  • 38
0

For the Program properties, on the Environment tab have you selected "Only when a user is logged on" & set Run Mode to Users Rights?

JaeBee
  • 136
  • 3