BEGIN { if ($^O =~ /\bMSWin32\b|\bcygwin\b/) { require Win32::API; Win32::API->import(); Win32::API->Import('kernel32', 'SetErrorMode', 'I', 'I'); my $errormode = SetErrorMode(1); # fetch old error mode SetErrorMode(1 | $errormode); # no AbortRetryFail messages anymore }; }; # Now, Windows won't ask you to insert a drive into an empty device