Print

Disable Protected Mode in Adobe Reader X

Written by Daniel Mundy on Friday, 27 May 2011 09:44.

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe\Acrobat Reader\10.0\FeatureLockDown]

Add the following DWORD value

bProtectedMode (dword:00000000)

 

Print

HP MicroServer

Written by Daniel Mundy on Friday, 27 May 2011 09:14.

A bunch of useful links: http://forums.overclockers.com.au/showthread.php?t=905262

Someone who set theirs up as an XBMC: http://forum.xbmc.org/showthread.php?t=104372

 

Print

Script to Read Disk Volume

Written by Daniel Mundy on Friday, 13 May 2011 10:19.

The following batch script will read the volume label for a given disk (eg: c:) into a variable called %v%

@echo off & setLocal enableDELAYedexpansion

for /f "tokens=1-5* delims= " %%a in ('vol c:') do (
set v=%%f
goto :done here
)
:done here
echo label is !v!

 

Print

Scheduled Tasks

Written by Daniel Mundy on Wednesday, 13 April 2011 14:21.

Create a scheduled task that runs every hour, 24 hours a day:

  1. Schedule the task to run daily at 09:01
  2. Click the Advanced button and configure the task to repeat every 1 hour until 08:59
Print

Script to record backup disk changes

Written by Daniel Mundy on Wednesday, 13 April 2011 11:30.

@echo off

set driveletter=G
set working=C:\Scripts
set log=%working%\Backup-disk.log

set thedate=%date:Mon =%
set thedate=%thedate:Tue =%
set thedate=%thedate:Wed =%
set thedate=%thedate:Thu =%
set thedate=%thedate:Fri =%
set thedate=%thedate:~6,4%/%thedate:~3,2%/%thedate:~0,2%
set thetime=%time:~0,2%:%time:~3,2%:%time:~6,2%
set datestamp=%thedate:/=%%thetime::=%
set datestamp=%datestamp: =%

if not exist %driveletter%:\diskid2.txt echo %datestamp% > %driveletter%:\diskid2.txt

set /p diskid= %working%\lastdisk.txt
set /p lastdisk=> %log%
    exit
)

if %diskid%==%lastdisk% (
    echo %thedate% - %thetime% - Disk was not changed since last check >> %log%
)

if not %diskid%==%lastdisk% (
    echo %thedate% - %thetime% - The disk at drive letter %driveletter% was changed to: %diskid% >> %log%
    echo %diskid% > %working%\lastdisk.txt
)
Print

How permissions are handled when you copy and move files and folders

Written by Daniel Mundy on Monday, 11 April 2011 15:30.

When you copy a file from folder A to folder B the file will inherit the permissions of folder B, as expected.

But when you move (cut and paste) a file from folder A to folder B, it will not inherit the permissions of folder B. Instead it will keep the permissions it had in folder A.

An example helps explain: Suppose you have a folder that only senior management have permission to access, called "Management Files". You have a file there that you want all staff to have access to, so you move it into the "All Staff" folder by using cut and paste. A staff member tries to access the file but is denied access, even though they have access to the "All Staff" folder!

Note: This only affects Windows 2000, XP and Server 2003. It have been fixed in Vista, Windows 7 and Server 2008.

 

How to Stop it from Happening

This is documented in Microsoft KB article 310316.

"You can modify how Windows Explorer handles permissions when objects are moved in the same NTFS volume. As mentioned, when an object is moved within the same volume, the object preserves its permissions by default. However, if you want to modify this behavior so that the object inherits the permissions from the parent folder, modify the registry as follows"

In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer create a DWORD called MoveSecurityAttributes and set it to 0.

How to Clean Up After the Fact

You can use the following script to reset permission inheritance of your files, but still preserve the permission structure of your folders.

The following script takes ownership of the given folder and all files/folders beneath it. It then prints a list of files into %temp%\filenames.tmp. This list does not include any folders, only files. It then goes through the list and uses icacls to reset the permission inheritance on each of these files.

Save the script as C:\Windows\system32\fixpermissions.bat

Usage: fixpermissions.bat <folder>

@echo off
takeown /A /R /D Y /F %1
cd %1
dir /B /S /A-D > %temp%\filenames.tmp
for /f "delims=" %%a in (%temp%\filenames.tmp) do icacls "%%a" /reset
Print

Delete Folder when Path Too Long

Written by Daniel Mundy on Friday, 01 April 2011 08:23.

Sometimes you will try to delete a folder and get the error: PATH TOO LONG. This happens when there are files inside the folder where the full path is greater than 256 characters.

Options:

  1. Delete the folder by using its 8.3 short name. You can use dir /x <full path to file> to determine this
  2. Sometimes even the 8.3 short name is too long. Start renaming parent folders until the path is short enough.
  3. Use the following script to delete the folder

 

Script to Delete Folder when Path Too Long

This script will delete a folder even if the path is too long.

The script requires Robocopy, which comes with Vista and Windows 7, or you can download the exe for XP and Server 2003 and save it in C:\Windows\System32.

Save the script as DelFolder.bat, in C:\Windows\System32

Usage: DelFolder <full path to folder you wish to delete>

@echo off
if {%1}=={} @echo Syntax: DelFolder FolderPath&goto :EOF
if not exist %1 @echo Syntax: DelFolder FolderPath - %1 NOT found.&goto :EOF
setlocal
set folder=%1
set MT="%TEMP%\DelFolder_%RANDOM%"
MD %MT%
RoboCopy %MT% %folder% /MIR
RD /S /Q %MT%
RD /S /Q %folder%
endlocal

Source: http://www.windowsitpro.com/article/tips/jsi-tip-9651-how-can-i-delete-a-folder-that-returns-path-too-long-.aspx

Print

PowerShell script to enumerate rights in Exchange 2007

Written by Daniel Mundy on Thursday, 31 March 2011 08:15.

Source: http://www.ericwoodford.com/powershell-enumerate-delegate-rights-a-mailbox

Using the Quest Powershell addons for AD, this script reads the delegate permissions for a specified mailbox, then looks up the display name for each delegate or mailbox they are a delegate for.

$entry = Read-Host "Display name of mailbox"
if ($entry -ne $null) {
        $a= Get-QADUser $entry -ldapfilter '(mail=*)' -IncludedProperties displayname, publicdelegates, publicdelegatesbl
        foreach ($user in $a) {
                $user.displayname
                "================================="
                if ($user.publicdelegates -eq $null) {
                        Write-host "Has no delegates"
                } else
                {      
                        Write-host "Delegates:"
                    $b = $user.publicdelegates;
                        foreach ($del in $b) {Get-QADUser $del | select-object displayname| sort-object displayname};
                        "    "
                }
               
                if ($user.publicdelegatesbl -eq $null) {
                        Write-host "Is not a delegate"
                } else
                {
                                Write-Host 'Is a delegate for:'
                            $b = $user.publicdelegatesbl;
                                foreach ($del in $b) {Get-QADUser $del |select-object displayname| sort-object displayname};
                                "    "
                        }
                "    "
        }
}
Print

Amarok

Written by Daniel Mundy on Wednesday, 30 March 2011 19:32.

Being a KDE app, if you want to use it on Gnome, then you'll need to install these additional packages:

phonon-backend-xine
libxine1-ffmpeg

Otherwise you'll get messages about Photon not being able to play MP3 files. Or "playlist encountered too many errors".