Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Monday, March 24, 2014

VBoxManage modifyhd Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execution failed

This is a lol one. I tried extending the hard disk of a Virtual Machine and received the following error:

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd "E:\Virtual Machines\JIRA\Windows Server 2008.vdi" --resize 40960
VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execution failed (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or failed to start.

The Solution


Do *not* start Command Prompt as admin!

Monday, January 6, 2014

Compress Old Files with PowerShell

The Story


The following PowerShell script will compress files that are older than the specified amount of time. It is handy for archiving IIS Logs, SQL Backups, etc.
The script uses 7-zip so you obviously have to have it installed (or the exe copied somewhere). It's using maximum compression which is resource intensive, if you don't want that just remove the "-mx9 -m0=lzma2" parameters.


The Script

$path = "C:\inetpub\logs\LogFiles\"
$mask = "*.log"

$days = 7

$files = dir $path -Recurse -Include $mask | where {($_.LastWriteTime -lt (Get-Date).AddDays(-$days).AddHours(-$hours).AddMinutes(-$mins)) -and ($_.psIsContainer -eq $false)}


ForEach ($file in $files) {

    & "C:\Program Files\7-Zip\7z.exe" u -mx9 -t7z -m0=lzma2 ($file.FullName + ".7z") $file.FullName
    if ($LASTEXITCODE -eq 0) {
        Remove-Item $file
    }

}

Resources

Saturday, December 15, 2012

Deny Deleting a folder on Windows

Problem:
Setting the Deny Delete NTFS permission on a folder in Windows still allows me to delete it.


The Story:
Today I had a tricky issue. For some reason when I delete a movie from uTorrent it also deletes the parent directory which is the Movies folder. The data is not lost because it's a mounted NTFS Volume, but it's annoying to recreate the folder and remount it in Disk Management. So I thought it would be great to deny delete on that folder while allowing all operations below the parent. Setting Deny Delete to Everyone still let me to delete the folder, so I kept googling with no results.



Solution
Set the following permissions on the folder that shouldn't be deleted (in my case the Movies folder); leave all other permissions untouched:

  • Deny Delete
  • Deny Delete subfolders and files
  • Apply to: This folder only


Wednesday, October 24, 2012

Delete a wireless profile in Windows 8

Sometimes you're in the need to manually delete a wireless network profile, for example when your settings have changed and you can no longer connect to the wireless network.

Apparently, Windows 8 has removed this functionality from the GUI.

You have the following options left:


  • NETSH command


C:\Users\levente.rog> netsh wlan delete profile name="Chihuahua"
Profile "Chihuahua" is deleted from interface "Wi-Fi".

As a side-note, it's worth exploring the other options of netsh wlan.


  • 3rd Party Tool
WiFi Profile Manager 8 is a nice little tool written by Lee Whittington. Nice GUI, lightweight and easy to use. Get the tool from here.



  • Registry

Find the profile under the following registry path and delete the key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles


  • Windows Explorer

Navigate to C:\ProgramData\Microsoft\Wlansvc\Profiles\Interfaces to find and delete your profile (it's an xml file).



The hack explorer.exe shell:::{1fa9085f-25a2-489b-85d4-86326eedcd87} no longer seems to work, at least with build 6.2.9200.