Tag: windows 7

Change Hard Drive Size in VirtualBox

Virtual Box 5
Host: Mac
Guest: Windows 7

Make sure your virtual guest image is powered off.

In bash on your mac host, cd to your vdi folder and run VBoxManage modified:
cd "/Users/dirq/VirtualBox VMs/Win7”

Then run this command to resize the virtual hard drive:
VBoxManage modifyhd Win7.vdi --resize 102400
This is for 100g: (1024k x 100 = 102400)

Then you need to tell your guest windows image about the extra space.  In Windows 7:

  • Use the search and type “computer management”
  • Select Storage > Disk Management
  • Right click on the drive you want to expand (c:) and select “extend volume”

How to Run SQL Server Management Studio as a Different Windows User

If you’re using Windows Authentication for your SQL Server database you’ll need to run SQL Server Management Studio (SSMS) as that Windows account to test queries.  SSMS normally runs as the user logged in to Windows, but there is a simple way to run it as the database access account.

Just shift-right-click on a shortcut and select “Run as a different user“.  (Windows 7)

Shift-Right-Click a shortcut to run the program as a different Windows User.
Shift-Right-Click a shortcut to run the program as a different Windows User. (Windows 7)

You’ll be presented with a Windows login prompt.  Log in and SSMS will open.  Note that the connection dialog has the new user in the Windows Authentication area

Connect to Server Dialog
Connect to Server Dialog

Note: You’re now running the program as a different user, so it probably won’t have access to the files you normally use.  My fix was to give the account read/write to the folder where I hold my SQL scripts.

This tip will work for other programs too.  Let me know how you used it in the comments below.

Open a CMD Window From Anywhere!

In Windows 7, hold down shift and right click a folder to see some additional menu items.  You’ll notice a few extra options like “Open command window here” and “Copy as path”.

Shift + Right Click
Shift + Right Click

Open command window here

Often when browsing folders in Windows Explorer you will want to open a command shell, using the directory being viewed as the current directory:

cmd.exe opened to the selected folder
cmd.exe opened to the selected folder

Then you can do all sorts of cool things, like list out all the files in the directory using dir.

List a folder contents using DIR
List a folder contents using DIR

Copy as path

The “copy as path” option is also really handy on files, especially when uploading files to websites.  Now you can browse to an upload form, hit browse, and just paste in your copied path.

Copy as path, then paste into an upload form
Copy as path, then paste into an upload form