YMatrix Posted April 26, 2008 Posted April 26, 2008 Hello!I have read the MSFN guide all about the $OEM$ folder structure.I created a cmdlines that calls a batch file which creates the necessary registry keys.The batch itself runs like a charm, but I wanted the batch creation process to be "invisible" to the user.I tried using the cmdow.exe, but had no luck.in the " $OEM$ " directory, I created another directory of " $$ ". In this directory I created a " System32 "directory, in which I put the cmdow.exe.The directory structure:$OEM$ |-------$$ | ----------System32 | ------------ cmdow.exeAccording to the guide this file was supposed to be copied during the installation into the system32 directory, but for some reason it isn't being copied.So the obvious question is: Why isn't the file not being copied? Or should I say what am I doing wrong? More over, if someone knows a better way of doing this process (the cmdow.exe still creates a momentarily CMD window before activating its clock).Thanks for any help!
MHz Posted April 26, 2008 Posted April 26, 2008 According to the guide this file was supposed to be copied during the installation into the system32 directory, but for some reason it isn't being copied.So the obvious question is: Why isn't the file not being copied? Or should I say what am I doing wrong? Ensure that OemPreinstall=Yes within Winnt.sif as mentioned here within the unattended guide.You can use another language to hide the window or totally replace the cmd script. AutoIt can do a better job at hiding the window. The demonstration code below show how the window can hidden without any flicker.; create a test CMD fileFileWrite('test.cmd', 'pause'); show window then close$pid = Run('test.cmd')Sleep(5000)ProcessClose($pid)Sleep(1000); hide window then close$pid = Run('test.cmd', '', @SW_HIDE)Sleep(5000)ProcessClose($pid); remove test CMD fileFileDelete('test.cmd')MsgBox(0x40000, '', 'Demonstration finished')Exitor compile your own window hide exe from the below code; Usage: CompiledScript.exe "path/to/test.cmd"If $CMDLINE[0] Then Const $FILE = $CMDLINE[1] If FileExists($FILE) Then If StringRight($FILE, 4) = '.bat' Or StringRight($FILE, 4) = '.cmd' Then RunWait('"' & $FILE & '"', '', @SW_HIDE) EndIf EndIfEndIfOr perhaps try WScript.exe using VBScript or JScript. Or some other language.
YMatrix Posted April 26, 2008 Author Posted April 26, 2008 (edited) Ensure that OemPreinstall=Yes within Winnt.sif as mentioned here within the unattended guide.I am using nLite, and I don't want to lose the option to use the recovery option (R during start of txt setup).I chose in nLite in the unattended mode - prompt repair, so it disabled the OEMPreinstall.Anyway to keep the repair mode available and use the cmdow?As for the hiding part, I am trying to use NirCMD. Edited April 26, 2008 by YMatrix
MHz Posted April 26, 2008 Posted April 26, 2008 Just maker a SFX archive with NirCMD or Cmdow inside and execute from cmdlines.txt as the 1st entry. Tutorials exist on the Forums for making a 7-zip SFX archive or use WinRAR or some other archiver capable to make an unattended SFX.
YMatrix Posted April 26, 2008 Author Posted April 26, 2008 Just maker a SFX archive with NirCMD or Cmdow inside and execute from cmdlines.txt as the 1st entry. Tutorials exist on the Forums for making a 7-zip SFX archive or use WinRAR or some other archiver capable to make an unattended SFX.Worked like a charm!Used NirCMD and created a SFX archive using Winrar.
Martin H Posted April 27, 2008 Posted April 27, 2008 (edited) Instead of copying cmdow.exe in place with a SFX at T-12(cmdlines.txt), then i would personally just instead place the 2KB tool hidcon.exe into your $OEM$ folder and then add 'hidcon.exe ' infront of your RunOnceEx batchfile's name in cmdlines.txt.Unlike cmdow.exe, then hidcon.exe will not shortly show the cmd prompt before it's hidden...It can be downloaded from this russian page : http://unattended.solta.ru/unattended.ru.htm Edited April 27, 2008 by Martin H
YMatrix Posted April 27, 2008 Author Posted April 27, 2008 Thanks for the info!Another way to hide console windows
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