Microsoft
Using the NETSH command
The "netsh" command as many features such as changing firewall settings, bridging connections, changing routing, WINS, DNS, Winsock, ...etc. The list goes on and on. This topic will show you how to do the following:
- Set static IP
- Set static WINS
- Set Static DNS
- Reset Network configuration
- Automating the Process
Using the netsh command
To use the netsh command, open a command window and type netsh. Your command prompt should then display "netsh>" .
Write an INI file in C#
Add a using statement
using System.Runtime.InteropServices;
Example Code
public class IniWriter { #region | Public Properites /// <summary> /// Gets or Sets the File Path to the settings file. /// </summary> public string FilePath { get; set; } #endregion public const int DEFAULT_SIZE = 255; #region |DLL IMPORTS | [DllImport("kernel32")]
Enabling CLR Integration
EXECUTE sp_configure 'clr enabled', 1 GO RECONFIGURE WITH OVERRIDE GO
Enable xmp_cmdshell on Microsoft SQL 2008 Express
EXECUTE SP_CONFIGURE 'show advanced options', 1 RECONFIGURE WITH OVERRIDE GO EXECUTE SP_CONFIGURE 'xp_cmdshell', '1' RECONFIGURE WITH OVERRIDE GO EXECUTE SP_CONFIGURE 'show advanced options', 0 RECONFIGURE WITH OVERRIDE GO