Workaround for “Cannot execute a program” error message

You are here:
< Back

If you get an error such as

In Function: SharePointObject.ConnectLists 
Exception Number: 5 
Exception Description: Cannot execute a program. 
The command being executed was "C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe" /noconfig /fullpaths @"C:\Users\USERNAME\AppData\Local\Temp\m1nmwr_2.cmdline".

The problem may be due to:
1. Invalid Microsoft .NET Framework installation or bad/corrupted windows user profile
2. Inadequate permission on the part of the current user account to execute .exe files in the windows directory
3. Roaming user profile
Possible fixes:
1. Re-install Microsoft .NET Framework client. Refer this link for more
2. Make sure the current user can execute .exe files from the windows directory. For instance, you can verify that you can execute “csc.exe” from a command-line window? Even just typing “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe /?”
3. If using Windows Roaming Profiles, try disabling the roaming profile.