0
votes

I am trying to run following python script on windows powershell which is throwing following error

ERROR:

The term 'x86' is not recognized as the name of a cmdlet, function, script file , or operable program. Check the spelling of the name, or if a path was include d, verify that the path is correct and try again.

SCRIPT:

import os
import sys

Watchdog_config = 'C:\\Program Files (x86)\\Common Files\\ibm\\icc\\cimom\\data\\wmia.properties'
command1 = "PowerShell -Command \"& {(cat "+Watchdog_config+" )|%{$_ -replace {\"off\",\"on\"}}|set "+Watchdog_config+"}\""

os.system(command1)
1
Do print command1 and copy and paste that into powershell and see if it works. - korylprince

1 Answers

0
votes

Can you try :

Watchdog_config = '\"C:\\Program Files (x86)\\Common Files\\ibm\\icc\\cimom\\data\\wmia.properties\"'

I'am not confortable with python, I just want to enclose path into double quotes "".