PDA

View Full Version : Open file Command to Distinguish between (x86 or x64) OS



Larva King
06-12-2007, 09:02 PM
What would the syntax be for an open file command to only open that file if it is a (x86 or x64) OS.

Desolator
06-13-2007, 12:29 AM
Here you are:


if System.Is64BitOS() == true then
--[[
you can use File.Run, too, but if you don't need to get the return code
use Shell.Execute as File.Run can fail on Vista because of UAC
--]]
Shell.Execute( "AutoPlay\\Docs\\x64.exe", "open", "", "", SW_SHOWNORMAL);
else
Shell.Execute( "AutoPlay\\Docs\\x86.exe", "open", "", "", SW_SHOWNORMAL);
end

output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)