startnet.cmd命令里面的factory -minint
第一部分:
startnet.cmd
regsvr32 /s netcfgx.dll
factory -minint
netcfg -v -winpe
net start dhcp
net start nla
a:\floppy.cmd
第二部分:
//
// Internal Function(s):
//
static BOOL ParseCmdLine()
{
// Loop through all the arguments.
//
while ( lpArg && !bError )
{
// Now we check to see if the first char is a dash or not.
//
if ( *lpArg == _T('-') )
{
LPTSTR lpOption = CharNext(lpArg);
// This is where you add command line options that start with a dash (-).
//
// ISSUE-2002/02/25-acosma,robertko - We don't validate correct combinations of arguments. I can run
// "factory -setup -logon -winpe -oobe" and the last argument would be the one that is
// picked up. We should fix this and make it smarter.
//
if ( CHECK_PARAM(lpOption, _T("setup")) )
g_fm = modeSetup;
else if ( CHECK_PARAM(lpOption, _T("logon")) )
g_fm = modeLogon;
else if ( CHECK_PARAM(lpOption, _T("minint")) )
g_fm = modeMiniNt;
else if ( CHECK_PARAM(lpOption, _T("winpe")) )
g_fm = modeWinPe;
else if ( CHECK_PARAM(lpOption, _T("oobe")) )
g_fm = modeOobe;
else
bError = TRUE;
}
第三部分:
/*++
===============================================================================
Routine Description:
This routine is the main entry point for the program.
We do a bit of error checking, then, if all goes well, we update the
registry to enable execution of our second half.
===============================================================================
--*/
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// Check the command line for options (but don't error
// till we have the log file up).
//
bBadCmdLine = ( !ParseCmdLine() || ( g_fm == modeUnknown ) );
// Need to find the mode stuff: string, flags, and states.
//
dwLocate = LOCATE_NORMAL;
switch ( g_fm )
{
第四部分:
// We don't do the state thing in MiniNT mode right now (but we could).
// The modeMiniNt mode is only temporary the real mode in modeWinPe.
//
if ( g_fm == modeMiniNt )
{
// ISSUE-2002/02/25-acosma,robertko - This function does not check if we are running on WinPE, so users can just run factory -mini on any
// machine.
//
if ( !SetupMiniNT() )
{
FacLogFileStr(0 | LOG_ERR | LOG_MSG_BOX, L"Failed to install network adapter -- check WINBOM");
}
}
第五部分:
/*++
===============================================================================
Routine Description:
BOOL SetupMiniNT
This routine serves as the main entry point for initializing the netcard
under MiniNT. Also performs the tasks of changing the computer name
and establishing the computer as part of a local workgroup. Called from
factory!WinMain.
Arguments:
Return Value:
TRUE if netcard was correctly installed
FALSE if there was an error
===============================================================================
--*/
BOOL
SetupMiniNT(
VOID
)
{