PrintUI (CMD)

Add and remove local printer and driver through the command line. Can be used in scripts or packages. Before adding the printer, setup port and restart the Print Spooler service.

rundll32 printui.dll PrintUIEntry /if /b "ETIAM Print-in" /f "%ProgramFiles%\Etiam\Print-In\Driver\Print-in.inf" /r "PrintIn Port" /m "ETIAM Print-in" /q
rundll32 printui.dll PrintUIEntry /Xs /n "ETIAM Print-in" comment "ETIAM virtual printer" location "http://www.etiam.com" /q
rundll32 printui.dll PrintUIEntry /dl /n "ETIAM Print-in" /q
rundll32 printui.dll PrintUIEntry /dd /m "ETIAM Print-in" /q

Bootable USB Flash Drive (CMD)

A quick guide to make an USB Flash Drive bootable. This is usefull if you use Microsoft Windows installation images.

Open Command Prompt as an Administrator and go to town with these command steps:

diskpart
list disk (note the drive number of the USB flash drive)
select disk "drive number"
clean
create part pri - NOTE: if flash drive is larger than 32Gb use size=32000 or 16000 to limit size of partition for FAT32 file system
select part 1
format fs=fat32 quick
active
exit

Now the USB flash drive is ready for a Windows installation image

Source: Microsoft

Remote Assistance

Start Remote Assistance in Windows from the Command Line. You can also request help or offer your skills as an expert.

"%windir%\system32\msra.exe" /offerra
"%windir%\system32\msra.exe" /novice
"%windir%\system32\msra.exe" /expert

Usage
Create a shortcut and enter first command line, shown above, as the target. Remember to elevate/run as if you are using differenced user accounts

ICACLS examples (CMD)

Here are a few examples of the most common Icacls commands, that I use in Command Shell, to give further access.

icacls.exe "[folder]" /grant *S-1-5-32-545:(OI)(CI)F
icacls.exe "[folder]" /grant *S-1-5-32-545:(OI)(CI)M
icacls.exe "[path][file]" /grant *S-1-5-32-545:F
icacls.exe "[path][file]" /grant *S-1-5-32-545:M

For a complete list of ‘Well-known security identifiers’ (SIDs) please visit Microsoft.

Note: Icacls are build into Windows Vista, Windows 7 & Windows 8 and equivalent Windows Servers

Set ComputerName in TS (CMD)

Change the “Computer” or “This PC” to %COMPUTERNAME% in a Task Sequence.

Use SetACL, by Helge Klein, to change owner, set appropriate permissions on the registry key and after changing the registry key, releasing the key back to the system.

Place the appropriate SetACL.exe and the script below, together with the registry key and execute from TS.

"%~dp0setacl.exe" -on HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} -ot reg -actn setowner -ownr "n:S-1-5-32-544"
"%~dp0setacl.exe" -on HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} -ot reg -actn ace -ace "n:S-1-5-32-544;p:full;s:y"
..
.. 
"%~dp0setacl.exe" -on HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} -ot reg -actn ace -ace "n:S-1-5-32-544;p:read;s:y" "%~dp0setacl.exe" -on HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} -ot reg -actn setowner -ownr "n:S-1-5-18" 

This script has only been tested on Windows 7, x64, through a TS