Showing posts with label dos. Show all posts
Showing posts with label dos. Show all posts

Monday, August 27, 2007

Register an activex component

Register an activex component

look for regsvr32.exe in system/system32 folder in windows (note down the path)

Open dos prompt and do it!

C:\system32>regsvr32 c:\youractivex.ocx

A messagebox will appear if the ocx gets registered.

Monday, June 11, 2007

Backup Ms Sql Server Database using bat file

--Sometimes you may require a bat file to backup your ms sql server database.

@echo off
echo "Please press a key to backup you sql database.."
pause
echo "Backup process has started....This will take few minutes"
osql -U yourSqlUserName -P yourSqlPassword -Q "BACKUP DATABASE DatabaseName TO DISK = '%CD%\DatabaseName.BAK'"

pause

echo "You have Successfully Backup Up ... press a key to quit"
pause




--You might also want to restore your ms sql server database.

@echo off
echo "First Dropping your database if it exist... press a key"
pause
osql -U yourSqlUserName -P yourSqlPassword -Q "Drop Database DatabaseName"
echo "Restoring database ... press a key"
pause
osql -U yourSqlUserName -P yourSqlPassword -Q "RESTORE DATABASE DatabaseName FROM DISK = '%CD%\DatabaseName.BAK'"


echo "Restoring done ... press a key to quit"
pause