I'm an administrator on the computer and I get 'Access is denied' when this code is executed. 
 
Can anyone tell me why?
 
use Win32;
 
my $SourcePath = "c:\\winnt\\tools\\adlogon.txt";
my $DestPath = "c:\\winnt\\temp";
 
if( Win32::CopyFile( $SourcePath, $DestPath, 1 ) )
{
  print "Successfully copied!";
}
else
{
  print "Failed to copy. Error: $^E.\n";
}
 

Reply via email to