China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-27 08:56
中国DOS联盟论坛 » 其它操作系统综合讨论区 » How can I add a service to Local Area Connection with DOS commands? View 730 Replies 0
Original Poster Posted 2007-10-24 13:28 ·  中国 广东 东莞 电信
初级用户
★★
Credits 201
Posts 92
Joined 2005-12-28 17:44
20-year member
UID 48072
Status Offline
Here's the problem: I have a service INF file, and I can't install it by right-clicking it.

But if I right-click Local Area Connection and use Add Service, it installs correctly.

Now I want to solve this with a DOS command, but using the code below gives an error.

Experts, how can I fix this?
Below is the content of the INF:

;-------------------------------------------------------------------------
; netbridge.inf -- VMnet Bridge Protocol Driver
;
; Copyright (c) 1993-1999, Microsoft Corporation
; Copyright 1999-2007 VMware, Inc. All rights reserved.
;-------------------------------------------------------------------------

Signature = "$Windows NT$"
Class = NetService
ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318}
Provider = %CompanyName%
DriverVer = 01/26/2007,4.0.1.0
CatalogFile = vmnetbridge.cat


%CompanyName% = VMware, NTx86, NTia64, NTamd64

; Windows 2000

%VMware_Desc% = VMnetBridge.Install, vmware_bridge

; Windows XP and later

%VMware_Desc% = VMnetBridge.Install, vmware_bridge

; 64-bit Windows

%VMware_Desc% = VMnetBridge.Install, vmware_bridge

; Itanium-based systems (not supported)


;-------------------------------------------------------------------------
; Installation Section
;-------------------------------------------------------------------------

AddReg=VMnetBridge.Ndi
Characteristics = 0x4080 ; NCF_NDIS_PROTOCOL
CopyFiles = VMnetBridge.CopyFiles.Init, VMnetBridge.CopyFiles.Sys

; ------------------------------------------------------------------------
; File copy
; ------------------------------------------------------------------------

1=%DiskDescription%,"",,


vmnet.sys=1
vmnetbridge.dll=1
vmnetbridge.sys=1


DefaultDestDir = 12
VMnetBridge.CopyFiles.Init = 11 ; %windir%\System32
VMnetBridge.CopyFiles.Sys = 12 ; %windir%\System32\drivers

; Copying of vmnetbridge.dll

vmnetbridge.dll,,,2


vmnet.sys,,,2
vmnetbridge.sys,,,2

;-------------------------------------------------------------------------
; Ndi installation support
;-------------------------------------------------------------------------

HKR,Ndi,Service,,VMnetBridge
HKR,Ndi,HelpText,,%VMware_HelpText%
HKR, Ndi\Interfaces, UpperRange,, noupper
HKR, Ndi\Interfaces, LowerRange,,"ndis5,ndis4"

;-------------------------------------------------------------------------
; Keys required if a Notify object is present
;-------------------------------------------------------------------------
HKR, Ndi, ClsID, , {3d09c1ca-2bcc-40b7-b9bb-3f3ec143a87b}
HKR, Ndi, ComponentDll, , vmnetbridge.dll

;-------------------------------------------------------------------------
; Service installation support
;-------------------------------------------------------------------------

AddService=VMnetBridge,2,VMnetBridge.Service, VMnetBridge.EventLog


DisplayName = %VMware_Desc%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 2 ;SERVICE_AUTO_START
ErrorControl = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary = %12%\vmnetbridge.sys
LoadOrderGroup = "PNP_TDI"
AddReg = VMnetBridge.Service.Reg
Description = %VMware_Desc%


HKLM,"System\CurrentControlSet\Services\VMnetBridge","TextModeFlags",%REG_DWORD%,0x0001
; Don't delete -- edward
HKR,"Parameters\Adapters","Test",%REG_DWORD%,0


AddReg = VMnetBridge.EventLog.Reg


HKR,,EventMessageFile,0x00020000,"%11%\IoLogMsg.dll;%12%\vmnetbridge.sys"
HKR,,TypesSupported,0x00010001,7


;-------------------------------------------------------------------------
; Support for removal of static registry settings
;-------------------------------------------------------------------------

DelReg=VMnetBridge.Static.Reg


DelService=VMnetBridge


HKLM,"System\CurrentControlSet\Services\VMnetBridge","TextModeFlags"

;-------------------------------------------------------------------------
; String definitions
;-------------------------------------------------------------------------

CompanyName = "VMware, Inc."
VMware_Desc = "VMware Bridge Protocol"
VMware_HelpText = "Gives virtual machines access to physical networks."
DiskDescription = "VMware install disk"
REG_DWORD = 0x10001


The install command I used is:

"%cd%\netcfg.exe" -l "%cd%\netbridge.inf" -c s -i vmware_bridge
Forum Jump: