Link to home
Start Free TrialLog in
Avatar of MJSN
MJSNFlag for Afghanistan

asked on

How to covert a batch file into a Powershell Script

Need to convert this batch file and convert it to Powershell

  net stop winmgmt

  pause

  c:

  cd c:\windows\system32\wbem

  rd /S /Q repository

  regsvr32 /s %systemroot%\system32\scecli.dll

  regsvr32 /s %systemroot%\system32\userenv.dll

  mofcomp cimwin32.mof

  mofcomp cimwin32.mfl

  mofcomp rsop.mof

  mofcomp rsop.mfl

  for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s

  for /f %%s in ('dir /b *.mof') do mofcomp %%s

  for /f %%s in ('dir /b *.mfl') do mofcomp %%s

  mofcomp exwmi.mof

  mofcomp -n:root\cimv2\applications\exchange wbemcons.mof

  mofcomp -n:root\cimv2\applications\exchange smtpcons.mof

  mofcomp exmgmt.mof
ASKER CERTIFIED SOLUTION
Avatar of becraig
becraig
Flag of United States of America 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
Avatar of MJSN

ASKER

I will try this and let you know
SOLUTION
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
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Both scripts are valid translations into PowerShell code.