# Revision history [back]

In the past, my issues with executing on Windows has been with special characters and variable interpolation. I would suggest rewriting your code like this so your command is in one place. I'd also look at echoing your commands to see if Windows is reading them correctly. See below for my suggestion...

class alter_admin_group { if $::osfamily == 'windows' { #Alter_Admin_group exec { 'cmd.exe /c net localgroup Administrators domain\netgroups add': #Example-Try running the command cmd.exe /c echo "net localgroup Administrators domain\netgroups add" > C:\example.txt to see what is being passed to the system path =>$::path, group => 'Administrators', } } }

I hope this helps.

In the past, my issues with executing on Windows has been with special characters and variable interpolation. I would suggest rewriting your code like this so your command is in one place. I'd also look at echoing your commands to see if Windows is reading them correctly. See below for my suggestion...

class alter_admin_group {
if $::osfamily == 'windows' { #Alter_Admin_group exec { 'cmd.exe /c net localgroup Administrators domain\netgroups add': #Example-Try running the command cmd.exe /c echo "net localgroup Administrators domain\netgroups add" > C:\example.txt to see what is being passed to the system path =>$::path,
}
}


}

I hope this helps.

In the past, my issues with executing on Windows has been with special characters and variable interpolation. I would suggest rewriting your code like this so your command is in one place. I'd also look at echoing your commands to see if Windows is reading them correctly. See below for my suggestion...

class alter_admin_group {
if $::osfamily == 'windows' { #Alter_Admin_group #Alter_Admin_group exec { 'cmd.exe /c net localgroup Administrators domain\netgroups add': #Example-Try running the command cmd.exe /c echo "net localgroup Administrators domain\netgroups add" > C:\example.txt to see what is being passed to the system system path =>$::path,
}
}


}

I hope this helps.

In the past, my issues with executing on Windows has been with special characters and variable interpolation. I would suggest rewriting your code like this so your command is in one place. I'd also look at echoing your commands to see if Windows is reading them correctly. See below for my suggestion...

class alter_admin_group {
if $::osfamily == 'windows' { #Alter_Admin_group exec { 'cmd.exe /c net localgroup Administrators domain\netgroups add': #Example-Try running the command cmd.exe /c echo "net localgroup Administrators domain\netgroups add" > C:\example.txt to see what is being passed to the system path =>$::path,
}
}
}


}

I hope this helps.

In the past, my issues with executing on Windows has been with special characters and variable interpolation. I would suggest rewriting your code like this so your command is in one place. I'd also look at echoing your commands to see if Windows is reading them correctly. See below for my suggestion...

class alter_admin_group {
if $::osfamily == 'windows' { #Alter_Admin_group exec { 'cmd.exe /c net localgroup Administrators domain\netgroups add': #Example-Try running the command cmd.exe /c echo "net localgroup Administrators domain\netgroups add" > C:\example.txt to see what is being passed to the system path =>$::path,
}
}
}
}}}


I hope this helps.

In the past, my issues with executing on Windows has have been with special characters and variable interpolation. I would suggest rewriting your code like this so your command is in one place. I'd also look at echoing your commands to see if Windows is reading them correctly. See below for my suggestion...

class alter_admin_group {
if $::osfamily == 'windows' { #Alter_Admin_group exec { 'cmd.exe /c net localgroup Administrators domain\netgroups add': #Example-Try running the command cmd.exe /c echo "net localgroup Administrators domain\netgroups add" > C:\example.txt to see what is being passed to the system path =>$::path,
}}}


I hope this helps.