This is my code:
if !::File.exist?(\"#{node[\'iis\'][\'home\']}\\\\backup\\\\BkpB4Chef\") windows_batch \"Backup IIS Config\" do code <<-EOH \"#{node
Use Dir.exists?. You can also replace if ! condition by unless condition which reads a bit better.
Dir.exists?
if ! condition
unless condition
unless Dir.exist? "#{node['iis']['home']}\\backup\\BkpB4Chef" windows_batch "Backup IIS Config" do code <<-EOH "#{node['iis']['home']}"\\appcmd add backup BkpB4Chef EOH end end