Windows


Vista

Permissions

To grant all permissions (write and delete) to the user Administrator on file FILE do:

 icacls file /grant Administrator:(D,WDAC)

The same for all files recursively

 icacls c:\* /grant Administrator:(D,WDAC)

Cleanup Routine

http://www.annoyances.org/exec/forum/winxp/t1123307576

"Run Disk Cleanup and remove all but the last restore point. See if your System Restore cache and Recycle Bin size is set at a reasonable level (Say 1024Mb) on each drive, and reduce the IE Temporary Internet Files cache and History cache to the minimum. Install CCLeaner and clean out all of the junk files. Unhide all files and folders and remove the hotfix uninstallers ( $NTUninstaller$ ) from the hidden C:\Windows folder and remove their entries from Add-Remove programs. Then remove the contents of:

The C:\WINDOWS\Downloaded Installations folder The C: WINDOWS\SoftwareDistribution\Download folder The C:\WINDOWS\Temp folder The C:\Windows\pchealth\helpctr\Datacoll folder, and... The C:\Windows\Prefetch folder

(You can add these folders to EmpTemp if you have this program installed.) Then run chkdsk and defrag."

EmpTemp & CCLeaner

To make your shutdown clean, install the... UserProfileHiveCleanupService"

TweakUI is useful to have on your system for certain repairs... Powertoys/TweakUI

Cygwin

Install

1. http://cygwin.com/setup.exe

2. select software

  • Shell->OpenSSH
  • Shell->rxvt
  • Devel->Git
  • Interpreters->Perl

3. configure passwd/group as suggested

  • mkpasswd -l > /etc/passwd
  • mkgroup -l > /etc/group

Shell

  1. install rxvt
  2. edit the c:\cygwin\Cygwin.bat batch file with
   @echo off
   C:
   chdir C:\cygwin\bin
   rxvt -sr -e bash --login

Troubleshooting

   cygcheck -s -v -r

Logon scripts

Save this script as logon.vbs

Add/Remove Network drives

simple (vbscript)

   Option Explicit
   Dim objNetwork, strDriveLetter, strRemotePath
   strDriveLetter = "H:"
   strRemotePath = "\\server\C"
   Set objNetwork = CreateObject("WScript.Network")
   ' First we remove this drive:
   objNetwork.RemoveNetworkDrive strDriveLetter
   ' Then we add a new drive with said path
   objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
   Wscript.Quit 

advanced (vbscript)

   Option Explicit
   Dim strDriveLetter, strRemotePath
   Dim objNetwork, objShell
   Dim CheckDrive, AlreadyConnected, intDrive
   ' The section sets the variables.
   strDriveLetter = "W:"
   strRemotePath = "\\server\C"
   ' This sections creates two objects:
   ' objShell and objNetwork and counts the drives
   Set objShell = CreateObject("WScript.Shell")
   Set objNetwork = CreateObject("WScript.Network")
   Set CheckDrive = objNetwork.EnumNetworkDrives()
   ' This section deals with a For ... Next loop
   ' See how it compares the enumerated drive letters
   ' with strDriveLetter
   On Error Resume Next
   AlreadyConnected = False
   For intDrive = 0 To CheckDrive.Count - 1 Step 2
   If CheckDrive.Item(intDrive) =strDriveLetter _
   Then AlreadyConnected =True
   Next
   ' This section uses the If = then, else logic
   ' This tests to see if the Drive is already mapped.
   ' If yes then disconnects
   If AlreadyConnected = True then
   objNetwork.RemoveNetworkDrive strDriveLetter
   objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
   End if
   ' Now we map the drive
   objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
   WScript.Quit 

WINE

Tricks

Missing DLLs to run trivial applications?

Download the redistributable VC6 support DLLs from here: http://support.microsoft.com/kb/q259403/

Then do:

 wine vc6redistsetup_enu.exe

Extract to c:\windows\temp and then:

 wine ~/.wine/drive_c/windows/temp/vcredist.exe

Ignore errors about DLLs that were not copied; that just means that they already exist.

After that you will be able to run just about any trivial app.

Advertisement