PsPasswd
(
PsTools
)
Change account password
Syntax
pspasswd [[\\
computer[,
computer[,..] | @
file
[-u
user [-p
passwd]]]
Username [
NewPassword]
Options:
computer The computer on which the user account resides.
Default=local system
-p
passwd Specify a password for user (optional). Passed as clear
text.
If omitted, you will be
prompted to enter a hidden
password.
-u
user Specify a user name for login to remote
computer(optional).
@file Execute the command on each
of the computers listed in
the file.
Username Name of account for password change.
NewPassword The new password, If ommitted a NULL password is applied.
This tool allows administrators to create a batch file that will run against multiple computers to
perform a mass change of the administrator password.
Examples:
Change the password for user JDoe on \\workstation64
C:\> pspasswd \\workstation64 jdoe password567
“Drunk with power isn't the same as being drunk with booze” ~
Craig Ferguson
PUSHD
Change the current directory/folder and store the previous folder/path for use by
the
POPD
command.
Syntax
PUSHD [
drive]
path
PUSHD
Key
drive
The drive to switch to
path The folder to make 'current' (UNC names accepted)
If the
drive
is not specified, the current drive will be assumed.
If neither
drive
nor
path
are specified PUSHD will just display a list
of previous pathnames,
you may switch back to any of these by using
POPD
one or more times.
If the path specified does
not exist, PUSHD will return %errorlevel% =1
Run as Admin
When a batch script is 'Run as Admin' in Vista or Windows 7, the current directory will be set
to
C:\windows\system32\
.
Using the following pushd command at the start of the script will restore the normal current
directory.
This works by setting the current directory to the location of the batch script, using the
%0
parameter
pushd "%~dp0"
UNC Network paths
When a UNC
path
is specified, PUSHD will create a temporary drive map and will then use that
new drive.
The temporary drive letters are allocated in reverse alphabetical order, so if
Z:
is
free it will be
used first.
Chia sẻ với bạn bè của bạn: