Jump to content

Recommended Posts

antonioj84

Hi all to the forum guru and expert I am trying to  automate this. in the registry  I have the network profile name network 2 and network   I want to  change their  CATEGORY  to Private .  Can someone lead me in the right direction.

Private is 1 and Public is 0

#RequireAdmin

Global $sHKLMRoot = @OSArch = "x64" ? "HKLM64" : "HKLM"


RegWrite($sHKLMRoot &"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" ,'/v NetworkList /t REG_MULTI_SZ /d 00000000 /f')

see  attached picture below

Much appreaciate

 

registry.JPG

Edited by antonioj84

Share this post


Link to post
Share on other sites
xCROv

This topic over almost a year old and it doesn't look like you're really adding anything to it directly. It's prob best if you start your own topic.

 

You should follow the examples in this thread and read the regwrite function.

Share this post


Link to post
Share on other sites
Subz

As xCROv mentioned you should create a new thread and read the help file on RegWrite you will see your syntax is incorrect also you would need to use RegEnumKey, if you create a new post, I'll be happy to assist with your query.

 

Share this post


Link to post
Share on other sites
antonioj84

Thanks  Subz, and DanyFirex  Regnumkey was they key ingredient. If this can help someone else here is the code below 

#include <MsgBoxConstants.au3>
#RequireAdmin

Local Const $sHKLMRoot = @OSArch = "x64" ? "HKLM64" : "HKLM"

$iCategoryPrivate = 1
$iCategoryPublic = 0



Local $sSubKey =""
For $i =  1 To 2

$sSubKey = RegEnumKey($sHKLMRoot & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles", $i)
If @error Then ExitLoop




MsgBox($MB_SYSTEMMODAL, "SubKey #" & $i & " SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles: ", $sSubKey)


$sRegNetworkName = RegRead($sHKLMRoot & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\" & $sSubKey, "ProfileName")


 MsgBox($MB_SYSTEMMODAL, "Profile #" & $i & " SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles: ", $sRegNetworkName)


$Category = Int(RegRead($sHKLMRoot & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\" & $sSubKey, "Category"))


MsgBox($MB_SYSTEMMODAL, "Category #" & $i & " SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles: ", $Category)

;now you can write the key using regwrite to make category private or public
;~ RegWrite($sHKLMRoot & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\" & $sSubKey, "Category", "REG_DWORD", $iCategoryPrivate)


Next

 

Share this post


Link to post
Share on other sites
Subz

I would normally write it this way, so you're not limited by multiple network connections

#RequireAdmin
Local $sHKLM = @OSArch = 'x64' ? 'HKLM64' : 'HKLM'
Local $sMainKey = $sHKLM & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles", $sSubkey, $i = 1
Local $iCategoryPrivate = 1, $iCategoryPublic = 0
While 1
    $sSubkey = RegEnumKey($sMainKey, $i)
        If @error Then ExitLoop
    If RegRead($sMainKey & "\" & $sSubkey, "ProfileName") = "Network" Then
;~      Uncomment line below to change category
;~      RegWrite($sMainKey & "\" & $sSubkey, "Category", "REG_DWORD", $iCategoryPrivate)
    ElseIf RegRead($sMainKey & "\" & $sSubkey, "ProfileName") = "Network 2" Then
;~      Uncomment line below to change category
;~      RegWrite($sMainKey & "\" & $sSubkey, "Category", "REG_DWORD", $iCategoryPrivate)
    EndIf
    $i += 1
WEnd
  • Thanks 1

Share this post


Link to post
Share on other sites
JLogan3o13

@antonioj84 you have been around long enough to know better than to hijack an old thread rather than creating your own. Please do so in the future.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
antonioj84

jologan3013 , xcrov already make that point please what else are you adding. I don't think a year old is that old after all. Are you able to move it to a new Topic ?

Edited by antonioj84
errorh

Share this post


Link to post
Share on other sites
JLogan3o13

The old topic was a year old; I have split your intrusion into its own topic. What I am adding is that you need to create your own topics so someone from the Moderating team does not have to spend 20 minutes splitting them out.

Edited by JLogan3o13
  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • PhoenixPRO
      By PhoenixPRO
      When I try to automate this install program I can not get any of the buttons to click with the "ControlClick" function or any mouse movement to move the mouse to the and click it.  My OS is Windows 10 64Bit.  I have tried both 32bit and 64bit installs of Autoit V3 to no avail.
      I could not even get the run command to start the program until I used the variation of the command below in the script.
      With the script below the install program starts but will not click the "Next" button no matter what I do.
      Any help will be greatly appreciated.
      Thanks in advance.
       
      #include <MsgBoxConstants.au3>
      Opt("MouseCoordMode", 0) ;1=absolute, 0=relative to active window, 2=client
      Local $Success
      Run(@ComSpec & " /c " & 'C:\PhoenixPro_Install\RDXUtil\RDX_Tools_setup.exe', "C:\PhoenixPro_Install\RDXUtil", @SW_HIDE )

      WinWait("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      WinActivate("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      ControlClick ("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62", 1639, "left", 1) ;Next Button
    • TheWizEd
      By TheWizEd
      How do I work with 2D arrays.  I've tried this but get errors.
      Local $aTest[4][4] = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]
      ;$aTest[0][] = [10,11,12]  ; Error at []
      Local $sTest = ""
      For $i = 0 To UBound($aTest)-1
        Local $aExtract = _ArrayExtract($aTest,$i,$i)
        $sTest = $sTest & MyTest($aExtract)
      Next
      Func MyTest($aTemp)
        _ArrayDisplay($aTemp)
        ; Error at    v $aTemp
        Return String($aTemp[0]) & " - " & String($aTemp[1]) & " - " & String($aTemp[2]) & @CRLF
      EndFunc
       
       
    • AndyK70
      By AndyK70
      I'm trying to fill a ListView with all normal viewable windows to act with them.
      First I tried with WinList:
      Local $aWinList = WinList("[REGEXPTITLE:(?i)(.+)]") Local $aTmp, $iID ;~ _ArrayDisplay($aWinList) For $i = $aWinList[0][0] To 1 Step -1 ; going backwards not disturbing the index while cycling through and deleting some If StringStripWS( $aWinList[$i][0], 3) == "" Or _ Not BitAND(WinGetState($aWinList[$i][1]), $WIN_STATE_VISIBLE) Or _ BitAND(WinGetState($aWinList[$i][1]), $WIN_STATE_MINIMIZED ) Then _ArrayDelete($aWinList, $i) Else ; Window has a Title and is "visible" $aTmp = WinGetPos($aWinList[$i][1]) If $aTmp[0] < -1000 Or $aTmp[1] < -1000 Then ; Window is minimized or tray icon _ArrayDelete($aWinList, $i) EndIf EndIf Next $aWinList[0][0] = UBound($aWinList)-1 ; getting actual # of windows ; Each row is now [ID]=> [Title], [hWnd] But it keeps getting Windows which are definitely not there at least not visible:

      Those windows "Rechner", "Einstellungen", "Netflix", "Microsoft Store", ... are not there!?! 
      It should list only the first three windows, which are real.
      I even tried it with _WinAPI_ UDF:
      $hWnd = _WinAPI_GetForegroundWindow() ; Add items _GUICtrlListView_BeginUpdate($idListview) If $hWnd <> 0 Then $iI = 0 Do If _WinAPI_IsWindow($hWnd) And _WinAPI_IsWindowVisible Then _GUICtrlListView_AddItem($idListview, WinGetTitle($hWnd)) _GUICtrlListView_AddSubItem($idListview, $iI, $hWnd, 1) $iI += 1 $hWnd = _WinAPI_GetWindow($hWnd, $GW_HWNDNEXT) EndIf Until $hWnd = 0 EndIf But it is the same...
       
      How can i distinguish those invisible windows from normal ones?
      PS: I'm using Windows 10, maybe it is important to know?
    • davidacrozier
      By davidacrozier
      Hello all ~
      I am running an autoit script on Windows 10 inside VMware Workstation 12 Pro version 12.5.2.  Technically I am remoting into ESXi which has a Domain Controller (DC), WebServer, FilServer, Windows 10, etc.  Using the GUI (i.e. running explorer.exe) I am able to open several different folders successfully.  The desktop, documents, USB external all open without issue.  The network share opening gives me issues.  Whenever I attempt to open \\filserver\users\user\sharedfolder I get the documents folder instead.  I understand that the documents folder is the default for explorer.  I have also attempted to use the letter drive mapped to the network share (Z:) and receive the same result.  When I run this script on Windows 10 alone without  the VM or the ESXi I am able to open the network share without problems.  I have tried to use the net use command to designate a letter M: to the network share folder prior to running the script.  This did not work for me.  
      One additional avenue I think might work is to use the systreeview321 and _GUICtrlTreeView_FindItem to step through the tree looking for the network share.  Once found,  double click on it and see if that opens the shared network folder.  I can click inside the VM with my mouse on the network share and it opens just fine.  Not sure if running up against GUI issues, or permission issues, or what?
      Thanks in advance,
      Davida Crozier
      TestNetworkShare.au3
      This script is a subset of a much larger program, but it illustrates what I am dealing with.

    • MrMajorThorburn
      By MrMajorThorburn
      Using sample code:
      #include <MsgBoxConstants.au3> ; Find a pure red pixel in the range 0,0-20,300
      Local $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000)
      If Not @error Then
          MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
      Else
          MsgBox($MB_SYSTEMMODAL, "", "Pure Not Found")
      EndIf ; Find a pure red pixel or a red pixel within 10 shades variations of pure red
      $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000, 10)
      If Not @error Then
          MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
      Else
          MsgBox($MB_SYSTEMMODAL, "", "Variant Not Found")
      EndIf   and the attached screenshot which has Pure Red (FF0000) in one icon in the area being searched. Would someone please check this out for me?
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.