Schiiwa Posted October 16, 2011 Share Posted October 16, 2011 (edited) This is the Vista´s code:#include"stdafx.h"#include"windows.h"int _tmain(int argc, _TCHAR* argv[]){ShellExecute(NULL,_T("open"),_T("x:\\Windows\\System32\\Mshta.exe"),_T("x:\\sources\\recovery\\tools\\CostumRestore.hta"),NULL,SW_SHOW);return 0;} As i read from the TechNet...http://technet.microsoft.com/en-us/library/dd744576%28WS.10%29.aspx Windows 7 Recovery Environment extracts the ICON for the options-menu from the Executeable. Vista takes it from OEMFactoryRestore.hta. As I read in Creating_a_Windows_Vista_Hard_Disk_Recovery_Solution.pdf, the Icon and Description can be included I will try to build an EXE compatible for Windows 7 x64.... But i have no experiences with C++ . I just did an dos-programm with Turbo C++, but i just could accomplish with help. I am installing MS Visual C++ Express right now. Do not know, if the *.h files are available there... Let´s see Will update when i have tryed it<Edit />1. Problem:Can´t add a "Resource File" as discribed in Creating_a_Windows_Vista_Hard_Disk_Recovery_Solution.pdfIs that a limitation of Visual C++ Express? Edited October 16, 2011 by Yzöwl Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 16, 2011 Share Posted October 16, 2011 Visual C++ Express Edition is very limited (none of the MFC/ATL/WTL bits for starters), and indeed, there is no resource editor included. It's by far the most limited of all the "Express Edition" compilers.Then again, if you're new to programming then perhaps using C++ isn't the best choice. Any programming language will let you do this easily (use ShellExecute on that HTA). You're making this a lot harder than it has to be (unless this runs under WinPE which very much narrows down your choices). Link to comment Share on other sites More sharing options...
Schiiwa Posted October 16, 2011 Author Share Posted October 16, 2011 Visual C++ Express Edition is very limited (none of the MFC/ATL/WTL bits for starters), and indeed, there is no resource editor included. It's by far the most limited of all the "Express Edition" compilers.Then again, if you're new to programming then perhaps using C++ isn't the best choice. Any programming language will let you do this easily (use ShellExecute on that HTA). You're making this a lot harder than it has to be (unless this runs under WinPE which very much narrows down your choices).Just wanted to add:EDIT:JUST FOUND:Visual C++ Express editions don't have a resource editor. That is one of its limitations. But i need a executeable with a valid description and icon to display my EXE in the recovery-options-menu when i boot to winre... And the only code i found was c++ Link to comment Share on other sites More sharing options...
Schiiwa Posted October 16, 2011 Author Share Posted October 16, 2011 My brother is in a computer science apprenticeship.... he is able to compile for me Let´s see, if it will success BTW.: Why did you edit my post CoffeeFiend. And why are you a coffeefiend Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 16, 2011 Share Posted October 16, 2011 Visual C++ Express editions don't have a resource editor. That is one of its limitations. You could have just read what I wrote directly above:there is no resource editor includedI thought that was pretty clear...Why did you edit my post CoffeeFiendI didn't.Please stop using the acute accent (´) as if it's some sort of single quote! Link to comment Share on other sites More sharing options...
Schiiwa Posted October 17, 2011 Author Share Posted October 17, 2011 You could have just read what I wrote directly above: I knowI thought that was pretty clear...I just found out while u where answeringI didn't. Strange... thought i've read "This post has been edited by CoffeeFiend" ...Now it has been edited by Yzöwl Please stop using the acute accent (´) as if it's some sort of single quote!OK, i'll tryNow my brother has compiled the EXE and it works fine, but just in the normal OS... When I boot to WinRE, it says something about a missing subsystem. I guess it is because of the wrong architecture. My WinRE is x64, but the Application created with Visual C++ is an Win32-Application The Recovery-Environment does well with the Icon and Description, but when i click on the option, a window pops up that there´s something wrong!When I open the CMD and try to run, it returns the error with the missing subsystem! ... Now got stuck ... No idea how to continue I Also tryed to compile the EXE with Quick Batch File CompilerLike robbo101 here:But with the same result (missing subsystem) .... Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 17, 2011 Share Posted October 17, 2011 OK, i'll tryVery much appreciated! Now my brother has compiled the EXE and it works fine, but just in the normal OS... When I boot to WinRE, it says something about a missing subsystem.Chances are that it's compiled in a way that requires you to install the Visual C++ redist first. I guess it is because of the wrong architecture. My WinRE is x64, but the Application created with Visual C++ is an Win32-Application No. 32 bit apps work fine on a 64 bit OS.The Recovery-Environment does well with the Icon and Description, but when i click on the option, a window pops up that there´s something wrong!When I open the CMD and try to run, it returns the error with the missing subsystem! ... Now got stuck ... No idea how to continue If you paste the actual error message (even if it's not in english) then we might know what the problem is for sure. It could be a number of other things, like your app working fine but WinRE not supporting HTA files (not having the winpe-hta package built-in). Not that I use WinRE or WinPE. Link to comment Share on other sites More sharing options...
Schiiwa Posted October 17, 2011 Author Share Posted October 17, 2011 (edited) If you paste the actual error message (even if it's not in english) then we might know what the problem is for sure. It could be a number of other things, like your app working fine but WinRE not supporting HTA files (not having the winpe-hta package built-in). Not that I use WinRE or WinPE.This was really a fast answer ....NOPE, HTA works well. I can call any hta with "MSHTA.EXE somehta.hta"The actual massage, when i try to run the executeable via CMD, this will return:The subsystem needed to support the image type is not presentDas zum Unterstützen des Abbildtyps erforderliche Subsystem ist nicht vorhanden.Yeah... I can offer u 2 languages And what do u use EDITNo. 32 bit apps work fine on a 64 bit OS.The application works well under Windows but not under WinRE Edited October 17, 2011 by Schiiwa Link to comment Share on other sites More sharing options...
Schiiwa Posted October 17, 2011 Author Share Posted October 17, 2011 The reason which i figured out is, that WOW64 isn´t available for WinPE x64 Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 17, 2011 Share Posted October 17, 2011 The subsystem needed to support the image type is not presentDas zum Unterstützen des Abbildtyps erforderliche Subsystem ist nicht vorhanden.Yeah... I can offer u 2 languages That's ok. Ich spreche ein bisschen Deutsch Et français aussi And what do u use Instead of WinRE? Nothing. I simply don't have a use for it.The reason which i figured out is, that WOW64 isn´t available for WinPE x64 Ouch. Didn't see that one coming as I don't use WinPE or WinRE. But yeah, it's pretty limited -- no .NET framework built-in either. The good news is recompiling should fix that (or using the 32 bit version of WnPE) Link to comment Share on other sites More sharing options...
Schiiwa Posted October 17, 2011 Author Share Posted October 17, 2011 (edited) I already made it. After a little bit of googeling and taking over my brothers PC with remote-desktop i changed the platform to x64 and re-comiled.2 Files were missing and after I implemented them into X:\Windows\System32 all works fine! Just have to edit the HTA-script for my needs I personally like a recovery-option because I have installed windows enough! I think more often than a normal user would in 10 lifes But this computer i am preparing is for my little brother (15 years) and I know what's gonna happen I will copy the nessessary partitions also to another disk, because i had some hdd-crashes also and this one isn´t new Edited October 17, 2011 by Schiiwa Link to comment Share on other sites More sharing options...
jaclaz Posted October 17, 2011 Share Posted October 17, 2011 I already made it. After a little bit of googeling and taking over my brothers PC with remote-desktop i changed the platform to x64 and re-comiled.2 Files were missing and after I implemented them into X:\Windows\System32 all works fine! Are you going to post WHICH EXACTLY "2 files" were missing? Or do we need to apply some torture to extort you this information? Boy, do I hate reports of success that completely FAIL to detail HOW EXACTLY the goal was reached.... jaclaz Link to comment Share on other sites More sharing options...
Geej Posted October 17, 2011 Share Posted October 17, 2011 Or do we need to apply some torture to extort you this information? i love this option but is it against MSFN forum rules? (LOL ) Link to comment Share on other sites More sharing options...
Schiiwa Posted October 17, 2011 Author Share Posted October 17, 2011 (edited) Boy, do I hate reports of success that completely FAIL to detail HOW EXACTLY the goal was reached.... HERE AGAIN FOR THE GRAND MASTER JAYCLAZ:changed the platform to x64 and re-comiled.Because of the ProblemThe reason which i figured out is, that WOW64 isn´t available for WinPE x64Don´t be rude my friend. I didn´t write in here EXACTLY the 2 files, because you will be informed through the executeable..... But If you want details...here we go!First it said: mfc100u.dll not foundand after placing it from C:\Windows\System32 into the RE-image:\Windows\System32 (as we all here know, which has normally the letter "X" assigned), the next message was:msvcr100.dll not foundThen same procedure.... and ta-da.... The HTA was Popping up. And I didn´t write these details, because I am sure it hurts some copyrights because nearly everything is illegal. If MS haven´t changed the EULA of IMAGEX, i am not allowed to do a Image of my OS-Partition, right Jayclaz?? Maybe (but do not know) these files went to C:\Windows\System32 through the installation of Visual C++ (on my brothers Computer). But Maybe they are some standard WIN-FilesBTW... here´s the source-code#include "stdafx.h"#include "windows.h"int _tmain(int argc, _TCHAR* argv[]){ShellExecute(NULL,_T("open"),_T("x:\\Windows\\System32\\Mshta.exe"),_T("x:\\sources\\recovery\\tools\\RestoreImage.hta"),NULL,SW_SHOW);return 0;}And I saw the possibilities of Visual C++ the first time and was really flashed. So in my opinion, if someone buys and gets along with this programm, they already know the option to change the platform! It´s just because i have no idea of programming in C++ Additional Information: :w00t: :w00t: :w00t:You can change the platform in Visual C++ by opening the properties of your projekt and search for KONFIGURATION MANAGER!!!!!!!!!!!!!!!!!!Win32, X64 and Itanium will be available. As this box here holds an AMD, i chose x64 Edited October 17, 2011 by Schiiwa Link to comment Share on other sites More sharing options...
Schiiwa Posted October 17, 2011 Author Share Posted October 17, 2011 (edited) Not all tests finished yetone Problem left:I did this one:C:\Windows\System32\Reagentc.exe /setosimage /path Z:\ /target C:\WindowsMy costum-tool is displayed without specified the /costumtool-parameter. I´ve just specified my costum exe in WinREConfig.xml. That´s OK, but how can I remove the option at the bottom now (Reinstall Windows) ???when I do:reagentc /infoSetup activated = 1 how can i reset it to 0I´ve just ran:C:\Windows\System32\Reagentc.exe /setosimage /customtool /target C:\WindowsBut still Setup activated = 1 .... I'll reboot now and see the effectsSOLVED: The command directly above will hide the "Reinstall Windows" option, even though "Setup activated = 1" will leaveWonderful... all works fine (UNTIL NOW.... not ran the HTA till now... have to edit some things first). I´ll also add the BOOTKEY for /SETREIMAGE to F11, because the other PCs where my brother lives have the Acronis Boot loader installed, which can be activated with F11 Would be interesting, if F8 would be available anyway!? Maybe I will reinstall windows again, to create the ID=27 Recovery-Partition. But I think I will keep that back for my own PC/Notebook and simply deactivate the access through windows with:ATTRIBUTE VOLUME SET NODEFAULTDRIVELETTER=1Maybe also HIDDEN=1 and READONLY=1, but don´t know if it is possible to boot to win-re then.... we´ll seeCy@ soon in a HTA-Threat Edited October 17, 2011 by Schiiwa 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