Windows batch processing: automatically enable remote desktop and obtain information required for Logon. batch processing is required.

Source: Internet
Author: User
Tags echo message get ip

Windows batch processing: automatically enable remote desktop and obtain information required for Logon. batch processing is required.

The company's office space is located on two different floors, and the problem should be handled back and forth. Therefore, we think about using remote access to solve the problem. Most of my colleagues are not familiar with the computer. It is very costly to use the "Communication Software" and "phone" to teach my colleagues to enable remote desktop communication. In addition, the IP address and account password of the company are not managed in a unified manner. The premise of Using Remote Desktop is as follows: ① enable remote ② get IP address ③ get user name and password. After some thought, it is not complicated to solve these problems through batch processing.

When a colleague encounters a problem: I use the "Communication Software" to send the script to my colleague> execute with my colleague> use the Remote Desktop operation.

You can remotely.

 

@ Echo offcolor 1 Ftitle Request Remote Assistance echo. echo, right-click "Run as administrator" echo. reg add "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server"/v fDenyTSConnections/t REG_DWORD/d 0/f 1> % temp % \ result. tmp: enable remote desktop and hide the original output result if % errorlevel % = 0 (echo enabled remote desktop successfully .) Else (echo failed to enable remote desktop ...): display the output result echo. set/p pass = enter the computer password: echo account: % username %> % temp % \ help.txt echo password: % pass %> % temp % \ help.txt ipconfig | findstr "192.168.4"> % temp % \ ip. tmpset/p a = <% temp % \ ip. tmpecho IP: % :~ -14%> % temp % \ help.txt echo.: Get account, password, IP address information copy % temp % \ help.txt \ 192.168.4.21 \ Share :: copy the computer information to the shared if % errorlevel % = 0 (echo administrator has received the information and is waiting for processing .) Else (failed to send the echo message .) Del % temp % \ ip. tmp & del % temp % \ result. tmp: delete temporary file echo. pause

 

The effect is as follows:

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.