Monday, 6 May 2013

Create a TimeStamp Folder in windows - Batch script Backup

You can write a script to create a folder in Windows
Open the Command Prompt and type echo %date% to get todays date.
If we wanted to get the current year we can start 4 from the end, and 4 in length.
echo %date:~-4,4%
For the month we start with 7
echo %date:~-7,2%
For the day we start with 10
echo %date:~-10,2%
To create a backup using the batch script use this:
set TIMESTAMP=%DATE:~-10,2%-%DATE:~-7,2%-%DATE:~-4,4%

@echo TIMESTAMP=%TIMESTAMP%
xcopy C:\BACKUPS\*.* D:\BackupFolder\%TIMESTAMP%\ /e /i /y
This will copy everything on the folder Backups from C Drive to BackupFolder on D Drive with a time stamp folder.

Monday, 1 April 2013

How to create a Windows service to start or run a program

At your command prompt, use the "sc create" Windows command to create your service. The correct syntax is as follows
How to create a Windows service to start or run a program automatically when starting your computer
C:\>sc create ServiceName binPath= "C:\Program Files\Programname\program.exe
to delete a service C:\sc delete ServiceName

Cant connect to esxi 4 box using vsphere client

Cant connect to esxi 4 box using vsphere client
1. Ping the console with the IP
2. connect to the ESXi from web browser using the ip
3. restart your network devices
4. In the console F2 to Customize the system. Disable and then enable the Management Network if you get this error.

Wednesday, 6 March 2013

Create a Virtual Machine of your Existing Computer

Microsoft’s Sysinternals team has released a simple application called Disk2vhd, that lets you easily migrate an existing computer to a virtualized hard drive (VHD). It’s a tiny utility doesn’t even require instillation.
Create Virtual Hard Disks with Disk2VHD
When you run Disk2vhd, it will immediately show you all the drives and partitions on your computer that it can migrate to a VHD. Simply select a drive that you wish to create a VHD file from and click “Create.” Disk2vhd will convert the hard drive into a VHD file even if the computer /drive is currently in use.
When the Virtual Machine VHD file is created, you can run it in any desktop virtualization program including the free Windows Virtual PC, Virtual Box, or VMware Player. You can also mount the virtual machine as a standard hard drive in Windows 7, and can even boot from it if your computer is running Windows 7 Ultimate.

Monday, 4 February 2013

Last logged in username in Windows XP

The default last logged in username can be found in"DefaultUserName"HKLM\Software\Microsoft\WindowsNT\CurrentVersion\WinLogon
If you want to clear the last logged in user from the registry,
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
"DontDisplayLastName" change the value to 1