gerardsweeney Posted October 1, 2012 Share Posted October 1, 2012 Hello, all.. I suspect I know what the answer is going to be here, but I figure nothing ventured etc. I've started looking at Win 7 X64 within my workplace where previous we'd just used XP and 7 32 bit. I have several compiled AU3 scripts that I use for building/config of PCs. For example, running simple things like: pkgmgr /iu:"TelnetClient" among installation of many other things we put on our standard PCs. On my 32 bit 7 PC, my 32bit compiled Au3s work fine. However, if I try to execute the above from a 64 bit then PKGMGR fails saying that I can't run the 64bit app from a 32bit script. Which makes sense So is there a way from within AutoIt where it can be compiled as a 32 bit app, but launch in 64bit mode? I hope that makes sense. Try not to flame me too hard - like I said, I think I already know the answer!!! Cheers, Gerard Link to comment Share on other sites More sharing options...
gerardsweeney Posted October 1, 2012 Author Share Posted October 1, 2012 In case I wasn't clear here - I'm trying to avoid having 2 scripts which do precisely the same thing Cheers, Gerard Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 1, 2012 Share Posted October 1, 2012 Why can't you have one script? I don't understand your first post. There are no "modes", an application is either x86 or x64, it can't be both. Not sure what's wrong with PKGMGR or how it makes sense either. Can you elaborate? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
gerardsweeney Posted October 1, 2012 Author Share Posted October 1, 2012 I think I might know what it is - and it's that I'm a clod! DISM was another one which didn't work when launched from an X86 script on an AMD64 PC. For example: One of the AU3s installs some additional Windows components using DISM. Here's the first line of my BAT file: Dism.exe /Online /Get-Features > "%TEMP%Dism_RemoteServerAdministrationTools.log" You'll note the complete lack of anything before dism.exe If I run this BAT by itself, then it works - I get a list of installed features, as you'd expect. If I get an X86 compiled AU3 script to run the BAT (using runwait("blah.bat"), then I get: "You cannot service a running 64-bit operating system with a 32-bit version of DISM. Please use the version of DISM that corresponds to your computer's architecture." So the X86 compiled AU3 script is running a different DISM from the one which is run is you just manually run the the BAT file. I'm assuming it's to do with the Wow64DisableWow64FsRedirection mentioned in the help guide. I'll have a play Link to comment Share on other sites More sharing options...
gerardsweeney Posted October 2, 2012 Author Share Posted October 2, 2012 OK... I have it fixed I think this ties in with another discussion on here: The user there was trying to run something in @SystemDir On an X64 PC, the X86 compiled @SystemDir & Dism.exe" was pointing to C:WindowsSysWOW64Dism.exe, even with the DLLCall proposed there. I changed it (as per Emiel Wieldraaijer's suggestion) to @WindowsDir & "System32Dism.exe", and it runs the correct version of Dism. Hope that makes sense Link to comment Share on other sites More sharing options...
naxa Posted September 24, 2015 Share Posted September 24, 2015 maybe "Sysnative" should be used eg. "%SYSTEMROOT%\sysnative\Dism.exe" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now