DEV Community

Vadim Sohin , DevOps  Engineer
Vadim Sohin , DevOps Engineer

Posted on

windows cmd commands via puppet

Hey everyone, i need to run cmd commands in windows
i can achive it with exec blocks , but prefer to run it only once
pls see below the code example,
what is the best way like function or with file block ?
Thanks in advance!

class disable_updates_available::windows (
) {

exec { 'enter system32 directory':
command => "C:\Windows\System32\cmd.exe => cd /d '%Windir%\System32",
}

exec { 'execute takeownership of musnotification.exe':
command => "C:\Windows\System32\cmd.exe => takeown /f musnotification.exe",
}

Top comments (0)