How to make bootable pendrive using cmd.

 1) Run command prompt (cmd). This can be done by clicking start and typing typing cmd in Windows 7. In Windows Xp, click on start and then click on run. Type cmd and run. This will open the command prompt which will look like this:

2) Then run diskpart utility from command prompt, by typing ‘diskpart’ on command prompt and pressing enter. This will run the diskpart utility in a separate windows, which is shown in

3) Now put in your pendrive in a USB port. Your pen drive must be atleast 4 GB, 8 GB pendrive is best for this purpose. Now go back to the diskpart console and type ‘listdisk’ and press enter. This will list the various storage devices available. You can see the size column of the disk and here we can see that ‘disk 2′ is our pen drive. Warning: In your computer it may be some other number. In our case it is ‘disk 2′.

4) Then you have to type ‘select disk 2′ and press enter. Note: in our case it is disk 2, in your case it may be disk 3, or disk 1 or any other number. You can enter ‘detail disk’ to see the details of the disk after selecting it to verify that you have selected the correct disk.

5) Then you have to run a series of commands. The commands to be run in the order are:- clean

– create partition primary

– select partition 1

– active

– format fs=fat32

6) The format step will take some time. You can have a tea or coffee in the meantime and come back. After the format is complete you have to run ‘assign’ command. And after this you can exit diskpart utility by entering the ‘exit’ command. The steps are shown below:

– assign

– exit

7) After the format is complete, put in your original Windows 7 DVD in your DVD drive, or if you have an .iso image of the DVD, mount that image using any virtual drive software like Power ISO.

– Now go to My Computer, and open the contents of DVD Drive. Press ‘ctrl+a’ to select all contents and copy all the contents by pressing ‘ctrl+c’.

– Now go back to My Computer and open the USB Drive and press ‘ctrl+v’ to paste all the contents of DVD into the USB Disk.

when the copy finishes, you are done just remove the USB Drive safely and use it to install Windows 7 in your computer/laptop.

 

Here is the snapshot of above steps.

Image

Image

List Of Query Commands for getting Data from database

Get Single Record.

1. ModelName::model()->findByPk($primaryKey);
2. ModelName::model()->findByAttributes(array(‘columnName1’=>$value1, ‘columnName2’=>$value2));
3. ModelName::model()->find(array(‘condition’=>’columnName1=’.$value1. ‘ and columnName2=’.$value2));
4. Yii::app()->user->db->createCommand()
->select(‘*’)
->from(‘tableName’)
->where(‘columnName1=’.$value1.’ and columnName2=’.$value2)
->queryRow();

Get Last Single Record.

1. ModelName::model()->findByAttributes(array(‘columnName1’=>$value1, ‘columnName2’=>$value2,array(‘order’=>’Auto_Increment_ID desc’)));
2. ModelName::model()->find(array(‘condition’=>’columnName1=’.$value1.’ and columnName2=’.$value2,  ‘order’=>’auto_Increment_ID desc’));
3. Yii::app()->user->db->createCommand()
->select(‘*’)
->from(‘tableName’)
->where(‘columnName1=’.$value1.’ and columnName2=’.$value2.’ order by auto_Increment_ID’)
->queryRow();

Get Multiple Records.

1. ModelName::model()->findAll(array(‘condition’=>’columnName1=’.$value1.’ and columnName2=’.$value2));
2. ModelName::model()->findAll(‘columnName1=’.$value1.’ and columnName2=’.$value2);
3. ModelName::model()->findAllByAttributes(array(‘columnName1’=>$value1,’columnName2’=>$value2));
4. ModelName::model()->findAllByAttributes(array(‘columnName1’=>$value1,’columnName2’=>$value2),
$condition= ‘columnName3 <> :aliasName3 AND columnName4 >= :aliasName4 OR columnName5 = :aliasName5’,
$params =array(
‘:aliasName3’ => $value3,
‘:aliasName4’ => $value4,
‘:aliasName5’ => $value5,
));
5. Yii::app()->user->db->createCommand()
->select(‘*’)
->from(‘tableName’)
->where(‘columnName1=’.$value1.’ and columnName2=’.$value2)
->queryAll();