Because the stsadm command is too common in SharePoint maintenance, we need to create a quick reference to stsadm, in this way, we no longer need to enter the complete path of this command every time we use the stsadm command in the command line. For SharePoint 2007, stsadm.exe exists in C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ Bin \. For SharePoint 2010,stsadm.exe exists in C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ Bin \
Method 1 On the operating system desktop, perform the following operations: 1. Click on 'start'
2. Right click on 'computer 'and select Properties
3. Select 'advanced system settings'
4. Click on the 'environment variables... '
5. Now select the 'path' from System Variables
6. Click Edit
Now you will find that some PATH variables already exist. You only need to add the following new path ; C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ Bin \ Or ; C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ Bin \
Note: Do not forget; because different path values in the PATH variable must be separated;
After completing this task, you can directly use the stsadm command in the Command command window.
Method 2 Enter @ Set path = C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ Bin; % Path %
Or
@ Set Path = c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ bin; % PATH % You can directly use the stsadm command in the Command command window.
Method 3 Write the following vbs using notepad: Code Set wshshell = Wscript. Createobject ( " Wscript. Shell " )
Set wshenv = Wshshell. Environment ( " System " )
Wshenv ( " Path " ) = Wshenv ( " Path " ) & " ; C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ bin "
Wscript. Echo " Add stsadm path successfully "
Save it as addstsadmtopath. vbs. This file can be run directly. After running the file, it automatically loads the directory you set to the system path environment variable.