Irrylyn
asked on
Add commandds to startnet.cmd in WinPE 3.0
I have created a custom WinPE (3.0) for 802.1x authentication.
When I boot into WinPE and manually add the certificates, start dot3svc, and add eapuserdata and profile it works splendidly.
Now I would like to add these commands into the startnet.cmd file to run automatically, either by entering the commands in the startnet.cmd file or via batch or .vbs. Please advise how I should do this.
The commands are:
x:\windows\system32\certut il.exe -addstore root X:\8021x\rootcertificate.c er
x:\windows\system32\certut il.exe -addstore "CA" X:\8021x\subcertificate1.c er
x:\windows\system32\certut il.exe -addstore "CA" X:\8021x\subcertificate2.c er
net start dot3svc
netsh lan add profile filename="X:\8021x\Local Area Connection.xml" interface="Local Area Connection"
netsh lan set eapuserdata filename=X:\8021x\Wired-Wi nPE-UserDa ta-PEAP-MS Chapv2.xml allusers=yes interface="Local Area Connection"
---------
Keep in mind, these commands all work when entered manually. I just need to add them to the startnet.cmd to run automatically.
As always, your help is much appreciated!
When I boot into WinPE and manually add the certificates, start dot3svc, and add eapuserdata and profile it works splendidly.
Now I would like to add these commands into the startnet.cmd file to run automatically, either by entering the commands in the startnet.cmd file or via batch or .vbs. Please advise how I should do this.
The commands are:
x:\windows\system32\certut
x:\windows\system32\certut
x:\windows\system32\certut
net start dot3svc
netsh lan add profile filename="X:\8021x\Local Area Connection.xml" interface="Local Area Connection"
netsh lan set eapuserdata filename=X:\8021x\Wired-Wi
---------
Keep in mind, these commands all work when entered manually. I just need to add them to the startnet.cmd to run automatically.
As always, your help is much appreciated!
ASKER
1 & 2) was answered in https://www.experts-exchange.com/questions/27960841/command-line-in-vbs.html
3) How do I add a call to the vbscript in the startnet.cmd file?
3) How do I add a call to the vbscript in the startnet.cmd file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Create the following VBS and call it StartDot3.vbs:
'=========================
'StartDot3.VBS
'=========================
Dim WshShell
Set WshShell = CreateObject("WScript.Shel
commandLine = "certutil -addstore Root x:\8021x\rootcertificate.c
Return = WshShell.Run(commandLine, 0, true)
commandLine = "certutil -addstore CA x:\8021x\subcertificate1.c
Return = WshShell.Run(commandLine, 0, true)
commandLine = "certutil -addstore CA x:\8021x\subcertificate2.c
Return = WshShell.Run(commandLine, 0, true)
commandLine = "net start dot3svc"
Return = WshShell.Run(commandLine, 0, true)
commandLine = "netsh lan add profile filename=x:\8021x\LocalAre
Return = WshShell.Run(commandLine, 0, true)
commandLine = "netsh lan set eapuserdata filename=\8021x\Wired-WinP
Return = WshShell.Run(commandLine, 0, true)
Then edit startnet.cmd to run the VBS after wpeinit:
wpeinit
run .\8021x\StartDot3.vbs
------
1) what is the syntax to run the vbs?
2) In the VBS, I think "CA" needs to have quotations around it. Can I just add the quotations or do I need to put double quotations somewhere?
3) Will WinPE even run vbs? or would it be better to put it into a batch file or just add the command lines to the startnet.cmd file?