IIS Manager in Windows 10

Thanks to @SLaks comment above I was able to turn on IIS and bring the manager back. Press the Windows Key and type Windows Features, select the first entry Turn Windows Features On or Off. Make sure the box next to IIS is checked. If it is not checked, check it. This might take a … Read more

Command line to remove an environment variable from the OS level configuration

To remove the variable from the current environment (not permanently): set FOOBAR= To permanently remove the variable from the user environment (which is the default place setx puts it): REG delete HKCU\Environment /F /V FOOBAR If the variable is set in the system environment (e.g. if you originally set it with setx /M), as an … Read more

Hosting Git Repository in Windows

Here are some steps you can follow to get the git daemon running under Windows: (Prerequisites: A default Cygwin installation and a git client that supports git daemon) Step 1: Open a bash shell Step 2: In the directory /cygdrive/c/cygwin64/usr/local/bin/, create a file named “gitd” with the following content: #!/bin/bash /usr/bin/git daemon –reuseaddr –base-path=/git –export-all … Read more

How do I shutdown, restart, or log off Windows via a bat file?

The most common ways to use the shutdown command are: shutdown -s — Shuts down. shutdown -r — Restarts. shutdown -l — Logs off. shutdown -h — Hibernates. Note: There is a common pitfall wherein users think -h means “help” (which it does for every other command-line program… except shutdown.exe, where it means “hibernate”). They … Read more

port forwarding in windows

I’ve solved it, it can be done executing: netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33 To remove forwarding: netsh interface portproxy delete v4tov4 listenport=4422 listenaddress=192.168.1.111 Official docs

Convert a small PS script into a long line in a .BATch file

Double quote literals must be escaped as \” @echo off PowerShell^ $WindowFunction,$RectangleStruct = Add-Type -MemberDefinition ‘^ [DllImport(\”user32.dll\”, SetLastError = true)]^ [return: MarshalAs(UnmanagedType.Bool)]^ public static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);^ [StructLayout(LayoutKind.Sequential)]^ public struct RECT^ {^ public int Left;^ public int Top;^ public int Right;^ public int Bottom;^ }^ ‘ -Name \”type$([guid]::NewGuid() -replace ‘-‘)\” -PassThru;^ … Read more