Jump to content

Recommended Posts

Posted

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.exe

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? :blink:

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!


Posted
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? :blink:

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 file
FileWrite('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 file
FileDelete('test.cmd')

MsgBox(0x40000, '', 'Demonstration finished')

Exit

or 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
EndIf
EndIf

Or perhaps try WScript.exe using VBScript or JScript. Or some other language.

:)

Posted (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 by YMatrix
Posted

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.

Posted
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.

Posted (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 by Martin H

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...