Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do I use Net use in my RunOnceEx.cmd

Featured Replies

it doesn't map to my server drive

Net use u: \\pentium4\unattended\Apps\Firefox

I put this command in the file and it didn't map

Try calling this vbscript instead, as your batch file will run the vbscript and only continue when the network drive is available and mapped (useful when waiting for a slow wireless net connection to fire up too):

Dim sTestPath
Dim intCount
Dim objnet

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

' An UNC path here that will be available when network connection is in place
sTestPath = "\\pentium4\unattended
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 = 60 Then
MsgBox "Unable to connect to network share for 5 minutes. Please notify your network administrator."
Exit Do
End If
Loop

' share/folder available on server now, so continue
objnet.MapNetworkDrive "U:", "\\pentium4\unattended\Apps\Firefox","True","domain\user","password"

End If

Watch out for word wrap there - the whole objnet.MapNetworkDrive section is one line, not two (as it may appear here on the boards).

Edited by cluberti

  • Author

thanks but i'd rather just use a simple net use. I just don't understand why it didn't map. Do i need to do something special in the RunOnceEx.cmd to make it work?

see I have a list of apps i want to install from the network.

Ok you want to add Reg values to install on next reboot but you want the install from a network location instead of local or cd?

Is this right?

have you got network going or is it just your server and the client?

  • Author

Yes you got it

my server where the apps are located and a client machine i am installing them to .

All i want to do is a simple net use in the runonceex.cmd

Perhaps your network interface isn't working? Try putting in an ipconfig /all statement, then a pause, and see if you've even got an IP address.

I haven't gotten it to work from RunOnce so just call it from a command file someplace like this...

REG ADD %KEY%\075 /VE /D "Mapping Network Drives" /f

REG ADD %KEY%\075 /V 1 /D "%systemdrive%\install\Network\Network.cmd" /f

  • Author

ok during the install of windows xp. I map to

u: \\pentium4\unattended\apps

this works fine. it maps. Inside the apps folder there is a firefox folder.

in my runonceex.cmd

i put

REG ADD %KEY%\008 /VE /D "FireFox 1.5" /f

REG ADD %KEY%\008 /V 1 /D "U:\Firefox\Firefox Setup 1.5.0.2.exe -ms" /f

i get unable to find \firefox\firefox

what am i doing wrong.

I think the VBS script that cluberti posted would be the best way to go, you can start the install from it.

Dim sTestPath
Dim intCount
Dim objnet




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

' An UNC path here that will be available when network connection is in place
sTestPath = "\\pentium4\unattended
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 = 60 Then
MsgBox "Unable to connect to network share for 5 minutes. Please notify your network administrator."
Exit Do
End If
Loop

' share/folder available on server now, so continue
objnet.MapNetworkDrive "U:", "\\pentium4\unattended\Apps\Firefox","True","domain\user","password"
'''' Checks to see if it in the correct directory
If objFSO.FileExists("U:\Firefox\Firefox Setup 1.5.0.2.exe") Then
objShell.Run(chr(34) & "U:\Firefox\Firefox Setup 1.5.0.2.exe -ms" & chr(34)),1,True
Else
objShell.Popup "Cannot Find This U:\Firefox\Firefox Setup 1.5.0.2.exe",10,"Missing", 0 + 32
End If
End If

I think the VBS script that cluberti posted would be the best way to go, you can start the install from it.

Dim sTestPath
Dim intCount
Dim objnet




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

' An UNC path here that will be available when network connection is in place
sTestPath = "\\pentium4\unattended
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 = 60 Then
MsgBox "Unable to connect to network share for 5 minutes. Please notify your network administrator."
Exit Do
End If
Loop

' share/folder available on server now, so continue
objnet.MapNetworkDrive "U:", "\\pentium4\unattended\Apps\Firefox","True","domain\user","password"
'''' Checks to see if it in the correct directory
If objFSO.FileExists("U:\Firefox\Firefox Setup 1.5.0.2.exe") Then
objShell.Run(chr(34) & "U:\Firefox\Firefox Setup 1.5.0.2.exe -ms" & chr(34)),1,True
Else
objShell.Popup "Cannot Find This U:\Firefox\Firefox Setup 1.5.0.2.exe",10,"Missing", 0 + 32
End If
End If

REG ADD %KEY%\008 /V 1 /D "U:\Firefox\Firefox Setup 1.5.0.2.exe -ms" /f

Note the spaces in your path! You would need it to look like this for what you are currently doing to work:

REG ADD %KEY%\008 /V 1 /D "\"U:\Firefox\Firefox Setup 1.5.0.2.exe\" -ms" /f

  • Author

thanks man

that did it.

Now it seems I can't get spybot 1.4 to install and autoupdate. I have checked the forums and even read the spybot faq's

once again what am i doing wrong?

REG ADD %KEY%\009 /VE /D "Spybot Search and Destory 1.4" /f

REG ADD %KEY%\009 /V 1 /D "\"U:\Spybot\spybotsd14.exe\" /verysilent /autoupdate" /f

What actually happens? Is it that the executable doesn't launch, or it does but doesn't install?

thanks man

that did it.

Now it seems I can't get spybot 1.4 to install and autoupdate. I have checked the forums and even read the spybot faq's

once again what am i doing wrong?

REG ADD %KEY%\009 /VE /D "Spybot Search and Destory 1.4" /f

REG ADD %KEY%\009 /V 1 /D "\"U:\Spybot\spybotsd14.exe\" /verysilent /autoupdate" /f

Try it without the backslash

REG ADD %KEY%\009 /V 1 /D ""U:\Spybot\spybotsd14.exe" /verysilent /autoupdate" /f

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.