Combine two for one system user to switch one button to complete

  
Windows XP is a multi-user operating system, each user's "My Documents" can be set to "special folder" (provided that NTFS partition), other users do not have access to The file inside. However, sometimes you need to access the "special folder" information in the current user environment. For example, when I write a report, I often need to call the customer data in other colleagues' "special folder", although it can be quickly switched by WIN + L However, in the process of switching, it is necessary to re-login as another user and interrupt the current user's network
connection, which brings a lot of inconvenience to the use. Now you can use the "Runas command + batch" to achieve the next key switch function in the current user environment.

First, make a batch processing

Open Notepad and enter the following text (Figure 1), save it as batch qIEhuan.bat and place it under f:\\.


Taskkill /im explorer.exe /f
Runas /profile /user:ymf c:\\Windows\\explorer.exe
EXIT

where:

/IM explorer.exe: Specify the image name of the process to be terminated (desktop process)
/f: Force the desktop process to terminate
/profile: Load the user's configuration file so that it can be completely accessed as a user "Private Folder"
/user:ymf:ymf User account name to be switched
Exit: Automatically exit the command prompt

Via Stargo (http://www.it8g .com
) Expert introduction, we know that the above command is used to force the end of the current user's desktop with the Taskur command, and then start the desktop as a YMF user (and load its configuration file).

Second, combined into one

Now if you want to access YMF's "special folder", just run "qIEhuan.bat", the system will immediately close the current desktop, and then enter as prompted YMF login password
(Figure 2); After successfully running "explorer.exe", the desktop becomes YMF desktop, and "My Computer" can be opened to easily access "Dedicated Folder". Since the YMF desktop is logged in, the programs launched through the desktop are all running as YMF (such as running regedit.exe, you can edit the YMF registry key). You can refer to the above command and make a return to the original desktop script (just edit the user name after /user:), which is convenient to switch back and forth.

Figure 2

The law should know the login password of other users (if the user does not have a login password, it cannot be used). In fact, the restricted file (clip) cannot be accessed because there is no corresponding permission, such as For example, when the folder is set to "dedicated folder", only "YMF" and "system" have full control rights. You can quickly change user permissions through the system's CACLS command. After logging in as the system administrator, enter "cacls "C:\\Documents and Settings\\ymf" /e /p administrator:f", so that the current user (administrator) ) Set the dedicated folder permissions for YMF to full control. As above, you can also use this command as a script to quickly access other user-limited documents. However, this method requires a permission change operation for each file (folder).

Copyright © Windows knowledge All Rights Reserved