Jump to content

Failure to map network drive during RunOnceEX Phase


Recommended Posts

Greetings all,

I am having difficulties in my attempts to map a network drive during the first login attempt after XP is installed. I have attempted to map the drive via a command in the winnt.sif [GUIRunOnce] section....

[GuiRunOnce]
"net use z: \\sovmtest\shared test /user:sovmtest\test /persistent:no"

as well as within the RunOnceEx.cmd...

@echo off

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

REG ADD %KEY%15 /VE /D "Mapping Network Drive" /f
REG ADD %KEY%15 /V /1 /D "net use z: \\sovmtest\shared test /user:sovmtest\test /persistent:no"

I've also attempted to map the drive by creating a netuse.cmd file:

@echo off

start "NetUse" /wait net use z: \\sovmtest\shared test /user:sovmtest\test /persistent:no

exit

and placing it in the $OEM$\$1\Install folder and executing it from both Winnt.sif...

[GuiRunOnce]
"%systemdrive%\install\netuse.cmd"

....and RunOnceEx

@echo off

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

REG ADD %KEY%02 /VE /D "Mapping Network Drive" /f
REG ADD %KEY%02 /V /1 /D "%systemdrive%\install\netuse.cmd" /f

With any of the methods shown above it is still failing to map the drive. However once the computer restarts after the RunOnceEX process completes, I can run netuse.cmd and it works correctly. And yes I have verified the credentials used to access the share are correct... User:test Password:test

I came across a forum post mentioning The Workstation Service has not been started.

I made the change to the hivesys.inf file as it indicated, with no effect.

Any help would be appreciated.

Sinistrality

Edited by Sinistrality
Link to comment
Share on other sites


First, my netcheck vb script:

Dim sTestPath
Dim intCount

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objVolatileEnv = objShell.Environment("VOLATILE")

' An UNC path here that will be available when network connection is in place sTestPath = "\\server\share"
sTestPath = "\\RISSERVER\REMINST\Setup\English\Images\WXP\UNATTEND"
intCount = 1

' test on volatile environment variable to avoid running logon script
' if the user has already run the logon script.
If Not objVolatileEnv("LogonScript") = "Done" Then

Do Until objFSO.FolderExists(sTestPath)
' sleep 5 seconds
WScript.Sleep 5000
intCount = intCount + 1
If intCount = 120 Then
MsgBox "Unable to connect to network share for 10 minutes. Please notify your network administrator."
Exit Do
End If
Loop

' share/folder available on server now, so continue

End If

Then, in my unattend.cmd file, I set the following variable (should map to the RIS Server's build folder if installed from a flat image):

reg query hklm\software\microsoft\windows\currentversion\setup /v sourcepath > source
for /f "tokens=3 skip=3" %%1 in (source) do set sourcepath=%%1

The very first thing I do in my unattend.cmd file, when configuring runonceex values, is to call the netcheck script before continuing (that way I know networking is up and I've got a valid IP, can get to the share, and things will work):

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Applications (Stage 1 of 3)" /f

REG ADD %KEY%01 /VE /D "Checking Network Connections" /f
REG ADD %KEY%01 /V 1 /D "%systemdrive%\temp\netcheck.vbs" /f

REG ADD %KEY%04 /VE /D ".NET Framework 1.1 SP1" /f
REG ADD %KEY%04 /V 1 /D "%sourcepath%\UNATTEND\dotnetfx\dotnet11.exe /q:a /c:\"install /l /q\"" /f
REG ADD %KEY%04 /V 2 /D "%sourcepath%\UNATTEND\dotnetfx\867460.exe /q" /f
REG ADD %KEY%04 /V 3 /D "%sourcepath%\UNATTEND\dotnetfx\886903.exe /q" /f
... and on, and on...

The reason I do it this way is because mapping drives during runonceex is frought with danger, but accessing UNC paths seems to always "just work".

Link to comment
Share on other sites

Looks like the netcheck fails, comes up with the 10 minute warning.. Running a paused ipconfig during runonceex phase shows the following:

IP Address 0.0.0.0

Subnet Mask 0.0.0.0

Default Gateway: Blank

DHCP Server: Correct

DNS Servers: Correct

I'm thinking maybe the workstation service isn't started? Or maybe I need to do a release & renew.

Guess I'll add an command to check the workstation service state... /shrug

Along with a Ipconfig /release and Ipconfig /renew...

whee!

Link to comment
Share on other sites

i use this to map the drive

the format:

net use z: //server_name/bbmak password /USER:username /persistent:yes

net use z: //server_name/bbmak 12345 /USER:bbmak /persistent:yes

and I use a disconnect command after everything install.

Link to comment
Share on other sites

yeah... I tried that in my first post.

Via the sc query lanmanworkstation command I have determined that the workstation service isn't started prior to the runonceex process execution.

Nor will it allow me to start the service.

I've made the change specified in JSI Tip 5638 and Error Message "The Workstation Service Has Not Been Started" When Using Cmdlines.txt with not positive effect.

The result of the net use command is this:

System error 67 has occured

The network name cannot be found

Not suprising since the workstation service isn't started and the computer isn't picking up an IP address.

At this point I'm inclined to start over from starting again from scratch. :wacko:

Or just run another runonceex.cmd after yet another reboot and start my network based installs

with

rundll32.exe c:\install\iernonce.dll,RunOnceExProcess

(given that IE7 breaks the runonceex process, pointing it to an older version of the file thank you Microshat.)

I think I'll do the latter and save my sanity's break for another day :blink:

Edited by Sinistrality
Link to comment
Share on other sites

Sinistrality,

Below is what I have used with no problems installing via network. I put the initial RunOnceEx.cmd in the $OEM$ folder, which is called by cmdlines.txt. Below is the system I use.

cmdlines.txt

[COMMANDS]

"useracct.cmd"

"RunOnceEx.cmd"

; Customized by nLite - www.nliteos.com

---------------------------------------------------------------------------------------------------------------------------

RunOnceEx.cmd

cmdow @ /HID

@echo off

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V RunOnceEx /D \\mercury\Installs\redstone_Apps.cmd /f

---------------------------------------------------------------------------------------------------------------------------

redstone_apps.cmd

cmdow @ /HID

@echo off

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Mercury System Files & Applications" /f

REG ADD %KEY%05 /VE /D "CCleaner" /f

REG ADD %KEY%05 /V 1 /D "\\File-server\installs\SysApps\CCleaner\ccsetup135.exe /S" /f

REG ADD %KEY%10 /VE /D "ClearType" /f

REG ADD %KEY%10 /V 1 /D "\\File-server\installs\SysApps\ClearType\ClearType.exe /S /v /qn" /f

REG ADD %KEY%20 /VE /D "Diskeeper" /f

REG ADD %KEY%20 /V 1 /D "\\File-server\installs\SysApps\Diskeeper\DK9.msi /qn" /f

REG ADD %KEY%25 /VE /D "Dot Net V1.1" /f

REG ADD %KEY%25 /V 1 /D "\\File-server\installs\SysApps\DotNet_V1.1\netfx.msi /qn" /f

---------------------------------------------------------------------------------------------------------------------------

Hope this helps.

JD

Edited by 03GrandAmGT
Link to comment
Share on other sites

Thanks for your input, however I can't get around the fact that the workstation service is failing to start, no workstation=no ip address/no network. I've managed to get around it by executing a second "runonceex" at the end of my initial runonceex.cmd, because on the next reboot the network works fine :ph34r:

Edited by Sinistrality
Link to comment
Share on other sites

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