Link to home
Start Free TrialLog in
Avatar of Irrylyn
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\certutil.exe -addstore root X:\8021x\rootcertificate.cer

x:\windows\system32\certutil.exe -addstore "CA" X:\8021x\subcertificate1.cer

x:\windows\system32\certutil.exe -addstore "CA" X:\8021x\subcertificate2.cer

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-WinPE-UserData-PEAP-MSChapv2.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!
Avatar of Irrylyn
Irrylyn

ASKER

How about this:

Create the following VBS and call it StartDot3.vbs:

'================================
'StartDot3.VBS
'================================
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")

commandLine = "certutil -addstore Root x:\8021x\rootcertificate.cer"
Return  = WshShell.Run(commandLine, 0, true)

commandLine = "certutil -addstore CA x:\8021x\subcertificate1.cer"
Return  = WshShell.Run(commandLine, 0, true)

commandLine = "certutil -addstore CA x:\8021x\subcertificate2.cer"
Return  = WshShell.Run(commandLine, 0, true)

commandLine = "net start dot3svc"
Return  = WshShell.Run(commandLine, 0, true)

commandLine = "netsh lan add profile filename=x:\8021x\LocalAreaConnection.xml"
Return  = WshShell.Run(commandLine, 0, true)

commandLine = "netsh lan set eapuserdata filename=\8021x\Wired-WinPE-UserData-PEAP-MSChapv2.xml allusers=yes interface=*"
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?
Avatar of Irrylyn

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?
ASKER CERTIFIED SOLUTION
Avatar of Irrylyn
Irrylyn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial