Jump to content

netsh interface 6to4 set state disabled syntax


stev379
 Share

Recommended Posts

What would be the correct syntax to change below from bat to AutoIT?

The first 3 lines work fine. It's just the last 2 I'm not seeing changes with. But no error when I run it in SciTE. These are all already pushed by GPO, but the first 3 do allow me to change and then "show" the status.

 

bat

netsh interface 6to4 set state disabled
netsh interface isatap set state disabled
netsh interface teredo set state disabled
netsh interface ipv6 set global randomizeidentifiers=disabled store=persistent
netsh interface ipv6 set privacy state=disabled store=persistent 

Change to this for AutoIT

#RequireAdmin
ShellExecuteWait("netsh.exe", 'int set interface "6to4" enable', "", "", @SW_HIDE)
ShellExecuteWait("netsh.exe", 'int set interface "isatap" enable', "", "", @SW_HIDE)
ShellExecuteWait("netsh.exe", 'int set interface "teredo" enable', "", "", @SW_HIDE)
ShellExecuteWait("netsh.exe", 'int set interface "ipv6" global randomizeidentifiers=disabled store=persistent', "", "", @SW_HIDE)
ShellExecuteWait("netsh.exe", 'int set interface "ipv6" privacy state=disabled store=persistent', "", "", @SW_HIDE) 

Also tried this and some others with the quotes moved around.

ShellExecuteWait("netsh.exe", 'int set interface "ipv6 global randomizeidentifiers=enabled store=persistent"', "", "", @SW_HIDE)
ShellExecuteWait("netsh.exe", 'int set interface "ipv6 privacy state=enabled store=persistent"', "", "", @SW_HIDE)

I'm running this to show the status:

netsh interface ipv6 show global
Edited by stev379
Link to comment
Share on other sites

don`t have experience with something like that but shouldn't they be ruined from cmd instead?

example of cmd with 2 echo together

i trued RunWait(@ComSpec & " /c " & "netsh interface ipv6 show global", @WindowsDir, @SW_SHOW), think it worked so my assumation is that other commands will work with it?

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

don`t have experience with something like that but shouldn't they be ruined from cmd instead?

example of cmd with 2 echo together

i trued RunWait(@ComSpec & " /c " & "netsh interface ipv6 show global", @WindowsDir, @SW_SHOW), think it worked so my assumation is that other commands will work with it?

 

Thanks for the reply. Yea, I first tired with Run or Runwait(@Comspec syntax, but had no luck, then found some stuff suggesting the other syntax. Though I might be seeing an error in my original @Comspec attempt now that I'm looking at it again. I'll give it a go again and let you know.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...