BatchPatch Forums Home › Forums › BatchPatch Support Forum › Not sure what I'm doing!
- This topic has 2 replies, 2 voices, and was last updated 6 years, 7 months ago by Kevin Hyland.
-
AuthorPosts
-
April 4, 2018 at 11:39 am #8946Kevin HylandParticipant
Hi
I’m trying to re-organise the sequence of Adapters and Binding on multiple Window 7 computers on a domain. I’m using the following in a simple batch file
nvspbind /++ “Wireless Network Connection” ms_tcpip
nvspbind /++ “Local Area Connection 4” ms_tcpip
nvspbind /++ “Local Area Connection 3” ms_tcpip
nvspbind /++ “Local Area Connection 2” ms_tcpip
nvspbind /++ “Local Area Connection” ms_tcpip
Which basically puts the Wireless Connection bottom of the pecking order with the LAN connections at the top
So this works fine on my local PC. So I modified it for updating of Remote PCs
@echo off
set uber=%1
psexec -nobanner -accepteula \%uber% -c nvspbind /++ “Wireless Network Connection” ms_tcpip >nul
psexec -nobanner -accepteula \%uber% -c nvspbind /++ “Local Area Connection 4” ms_tcpip >nul
psexec -nobanner -accepteula \%uber% -c nvspbind /++ “Local Area Connection 3” ms_tcpip >nul
psexec -nobanner -accepteula \%uber% -c nvspbind /++ “Local Area Connection 2” ms_tcpip >nul
psexec -nobanner -accepteula \%uber% -c nvspbind /++ “Local Area Connection” ms_tcpip >nul
psexec -nobanner -accepteula \%uber% -c nvspbind /o ms_tcpip
Yep – I know it’s not tidy, but need to check this works first!
And if I ran the Batch file with the remote computer name (ie ReOrderBind <computername>) then the Adapters were re-ordered on the remote computer. It works fine but no matter how I try I cannot get the same principle to work in BatchPatch. It says Success or Exit Code 0, no errors but doesn’t do anything to change the order of the adapters. If I manually run the Batch from CMD it runs and updates the Binding
I’ve two scripts, one with PSEXEC in the batch and the other as if I was running it locally on the remote PC. Never gets any errors from BP, tells me Success but doesn’t do anything.
Any assistance appreciated
Thanks
Kevin
April 4, 2018 at 6:05 pm #10423dougModeratorI created a batch file ‘nvspbind.cmd’ with the exact contents that you posted, only modified for my target computer’s network connections, which does not include a wireless connection. On my target computer I used the GUI to set my the binding order out of sequence (1,3,2,4).
Contents of my ‘nvspbind.cmd’:
nvspbind /++ "Local Area Connection 4" ms_tcpip
nvspbind /++ "Local Area Connection 3" ms_tcpip
nvspbind /++ "Local Area Connection 2" ms_tcpip
nvspbind /++ "Local Area Connection" ms_tcpipI then put a copy of nvspbind.exe in C:Windows on the target computer.
I then executed a BatchPatch deployment (using the same method as described here, but instead of deploying a .MSU I deployed the .cmd remotely-deploy-a-standalone-msu-update-to-multiple-computers ) to deploy nvspbind.cmd to the target computer. It ran successfully with Exit Code 0. I then verified in the GUI on the target computer that the bindings had been re-ordered successfully.
Another option that also works is if you don’t want to put a copy of nvspbind.exe on the target computers, instead you can put it in the same directory as your nvspbind.cmd file with just those two files (nvspbind.cmd and nvspbind.exe) in that directory. Then in your deployment settings you’ll still deploy the .cmd file, but then you’ll also tick the box that says ‘Copy entire directory…’ so that both the .cmd and the .exe get copied to the target. Then the batch file is executed, and the files are removed from the target after completion.
All that said, I don’t see any reason why you should not be able to do exactly what I just did.
-Doug
April 6, 2018 at 11:14 am #10426Kevin HylandParticipantThanks Doug
I didn’t try running the script as a software deployment – I was trying to run it locally or remotely as it’s a script.
Silly me!
Thanks again for the great support Doug
Cheers
Kevin
-
AuthorPosts
- You must be logged in to reply to this topic.