insomnai Posted October 21, 2011 Share Posted October 21, 2011 I've searched on the forum and found other posts with regards to this, but i've found a little hiccup that could use an assist with. I'm trying to use the following code, and depending on which way the exe is compiled, it works, or it doesn't! This code runs during a 'while' loop is running on a button. Run(@HomeDrive & "\windows\system32\msconfig.exe") If I compile the exe in x64 mode, the script works on x64 machines but not x86 machines. If it is compiled on x86 mode, it runs on x86 machines but not x64 machines. Wierd thing is, the path i've used is the same on both x86 and x64 machines so theoretically should work on both regardless of how I compile the exe. Thanks guys and gals. Link to comment Share on other sites More sharing options...
sleepydvdr Posted October 21, 2011 Share Posted October 21, 2011 (edited) I also ran into the exact same problem about a year ago. It seems to be a bug with launching msconfig on Win7. I never found a good solution. This was my band-aid: If FileExists(@WindowsDir & "\pchealth\helpctr\binaries\msconfig.exe") Then Run(@WindowsDir & "\pchealth\helpctr\binaries\msconfig.exe") Else Send("{LWINDOWN}r{LWINUP}") WinWaitActive("Run", "") Send("msconfig{ENTER}") EndIf Edited October 21, 2011 by sleepydvdr #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Yashied Posted October 21, 2011 Share Posted October 21, 2011 DllCall('kernel32.dll', 'int', 'Wow64EnableWow64FsRedirection', 'int', 0) Run(@SystemDir & '\msconfig.exe') DllCall('kernel32.dll', 'int', 'Wow64EnableWow64FsRedirection', 'int', 1) insomnai 1 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
insomnai Posted October 22, 2011 Author Share Posted October 22, 2011 (edited) Thank you both for your responses! It does seem as though there is a bit of an issue on Windows 7 machines, I wonder if this will be the same on the Windows Developer Preview or Windows 8 when it's finally released next year. I think I will try Yashied's method first, only because it doesn't involve using send commands, I'm trying to reduce my usage of them. Again, thank you very much! Yashied, could you explain what is happening with your code here? Many thanks... Edited October 22, 2011 by insomnai Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 22, 2011 Share Posted October 22, 2011 You guys (insomnai, sleepydvdr) need to read the File System Redirector part of Programming Guide for 64-bit Windows. Actually, if you think you'll ever do another script for a x64 OS, read the whole guide (especially the Running 32-bit Applications part). This is all really basic if you just check the documentation. insomnai and sleepydvdr 2 .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...
insomnai Posted October 22, 2011 Author Share Posted October 22, 2011 You guys (insomnai, sleepydvdr) need to read the File System Redirector part of Programming Guide for 64-bit Windows. Actually, if you think you'll ever do another script for a x64 OS, read the whole guide (especially the Running 32-bit Applications part). This is all really basic if you just check the documentation. I've only just started using the AutoIT scripting to create exe's so i'm currently learning on the fly and never had a reason to look at that page, however it is a great start so thank you for pointing it out! Link to comment Share on other sites More sharing options...
insomnai Posted October 26, 2011 Author Share Posted October 26, 2011 Hey guys, seconday question on this, by blocking redirection etc, do I compile this as x86 or x64...? Link to comment Share on other sites More sharing options...
Chimaera Posted October 26, 2011 Share Posted October 26, 2011 (edited) If you have disabled the redirect then i guess x86 should be fine heres mine #requireadmin DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) ShellExecute('msconfig.exe', -4) ; << 4 = which tab to display DllCall("kernel32.dll", "int", "Wow64EnableWow64FsRedirection", "int", 1) RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MSConfig") ; << stops the message after reboot Typo Edited October 26, 2011 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() 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