I guess shellexecute and run fails because of security issues. Most likely autoit doesnt have rights on the sys32 folder . This is why it works when you move it to the desktop. Look what your DLL call is doing - "This function is useful for 32-bit applications that want to gain access to the native system32 directory. By default, WOW64 file system redirection is enabled."