Archive for November, 2012

vbscript diskspace report

Sunday, November 25th, 2012
Found a nice little script which will check a system and report drive space.

In case the original link disappears; here it is.

Option Explicit

const strComputer = "."
const strReport = "c:\diskspace.txt"

Dim objWMIService, objItem, colItems
Dim strDriveType, strDiskSize, txt

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk _
      WHERE DriveType=3")
txt = "Drive" & vbtab & "Size" & vbtab & "Used" & vbtab & "Free" _
      & vbtab & "Free(%)" & vbcrlf
For Each objItem in colItems
  DIM pctFreeSpace,strFreeSpace,strusedSpace

  pctFreeSpace = INT((objItem.FreeSpace / objItem.Size) * 1000)/10
  strDiskSize = Int(objItem.Size /1073741824) & "Gb"
  strFreeSpace = Int(objItem.FreeSpace /1073741824) & "Gb"
  strUsedSpace = Int((objItem.Size-objItem.FreeSpace)/1073741824) & "Gb"
  txt = txt & objItem.Name & vbtab & strDiskSize & vbtab & strUsedSpace _
        & vbTab & strFreeSpace & vbtab & pctFreeSpace & vbcrlf

Next

writeTextFile txt, strReport
wscript.echo "Report written to " & strReport & vbcrlf & vbcrlf & txt

' Procedure to write output to a text file
private sub writeTextFile(byval txt,byval strTextFilePath)
	Dim objFSO,objTextFile

	set objFSO = createobject("Scripting.FileSystemObject")

	set objTextFile = objFSO.CreateTextFile(strTextFilePath)

	objTextFile.Write(txt)

	objTextFile.Close
	SET objTextFile = nothing
end sub
Advertisement

Where is cleanmgr for server 2008 R2

Saturday, November 24th, 2012

I had a case of a drive filling up with nothing significant to delete and of course everybody needed everything. I decided to run disk cleanup to see if I could at least compress old files.

I entered:  cleanmgr

I was rewarded with a file not found message.

It turns out the Desktop Cleanup utility is not a default install with 2008. There are two ways you can install it.

The first would be to install the Desktop Experience feature which adds other missing desktop features. The problem with this approach is the system will need a reboot to finish the install.

The second would be to simply copy a couple files to appropriate locations.

Look in the winsxs folder for the following:

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui

Simply copy:

Cleanmgr.exe to %systemroot%\System32

Cleanmgr.exe.mui to %systemroot%\System32\en-US

Now cleanmgr will function as expected.

This technote helped with the second option.

New Black Hole Exploit kit

Monday, November 19th, 2012

A security person on one of my lists posted this link. Rather heavy stuff but interesting if you want to learn this topic.

This is a worthwhile link to add to your collection: malware.dontneedcoffee.com

 

Citrix session screen flicker

Monday, November 19th, 2012

I had a user complain about screen flicker while trying to use tools on a server via remote desktop. The server in question was 32 bit windows 2003 running citrix presentation server 4.5. This was not wide spread so only the one server was having issues.

Searching the Net I found a technote at Microsoft which seem to address this issue.

I downloaded the hotfix, installed it and rebooted the server and the problem was solved.