使用psexec共享远程文件夹
2011-06-13 10:12
260 查看
Windows可以使用net share命令来共享文件。为了方便共享服务器中的文件夹,而不需要远程桌面登录后才可以设置,这里使用了SysinternalsSuite中的psexec.exe来实现远程直接共享。
一、共享命令
二、psexec远程执行
PsExec executes a program on a remote system, where remotely executed console
applications execute interactively.
Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l
][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...
] cmd [arguments]
-a Separate processors on which the application can run with
commas where 1 is the lowest numbered CPU. For example,
to run the application on CPU 2 and CPU 4, enter:
"-a 2,4"
-c Copy the specified program to the remote system for
execution. If you omit this option the application
must be in the system path on the remote system.
-d Don't wait for process to terminate (non-interactive).
-e Does not load the specified account's profile.
-f Copy the specified program even if the file already
exists on the remote system.
-i Run the program so that it interacts with the desktop of the
specified session on the remote system. If no session is
specified the process runs in the console session.
-l Run process as limited user (strips the Administrators group
and allows only privileges assigned to the Users group).
On Windows Vista the process runs with Low Integrity.
-n Specifies timeout in seconds connecting to remote computers.
-p Specifies optional password for user name. If you omit this
you will be prompted to enter a hidden password.
-s Run the remote process in the System account.
-u Specifies optional user name for login to remote
computer.
-v Copy the specified file only if it has a higher version number
or is newer on than the one on the remote system.
-w Set the working directory of the process (relative to
remote computer).
-x Display the UI on the Winlogon secure desktop (local system
only).
-priority Specifies -low, -belownormal, -abovenormal, -high or
-realtime to run the process at a different priority. Use
-background to run at low memory and I/O priority on Vista.
computer Direct PsExec to run the application on the remote
computer or computers specified. If you omit the computer
name PsExec runs the application on the local system,
and if you specify a wildcard (\\*), PsExec runs the
command on all computers in the current domain.
@file PsExec will execute the command on each of the computers listed
in the file.
program Name of application to execute.
arguments Arguments to pass (note that file paths must be
absolute paths on the target system).
psexec可以在远程机器上执行命令,下面是执行的命令
D:\Documents and Settings\huqunhui\psexec.exe \
\xxx.xxx.xxx.xxx -u username -p password net share my=I:\T2 /unlimited
一、共享命令
net share 用于以命令行方式管理共享. 语法: net share <sharename>=<drive>:\<directory>[/users=<number> or /unlimited] [/remark:"text"] net share <sharename> [/users=<number> or /unlimited][/remark:"text"] net share <sharename or device name or drive and path> /delete 选项: <sharename> 共享名 <device name> 指定打印机共享中的打印机名 <drive>:<path> 绝对路径 /users:<number> 同时连接到一个共享的连接数 /unlimited 不限制使用 /remark:"<text>" 对共享的说明 /delete 删除指定的共享
二、psexec远程执行
PsExec executes a program on a remote system, where remotely executed console
applications execute interactively.
Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l
][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...
] cmd [arguments]
-a Separate processors on which the application can run with
commas where 1 is the lowest numbered CPU. For example,
to run the application on CPU 2 and CPU 4, enter:
"-a 2,4"
-c Copy the specified program to the remote system for
execution. If you omit this option the application
must be in the system path on the remote system.
-d Don't wait for process to terminate (non-interactive).
-e Does not load the specified account's profile.
-f Copy the specified program even if the file already
exists on the remote system.
-i Run the program so that it interacts with the desktop of the
specified session on the remote system. If no session is
specified the process runs in the console session.
-l Run process as limited user (strips the Administrators group
and allows only privileges assigned to the Users group).
On Windows Vista the process runs with Low Integrity.
-n Specifies timeout in seconds connecting to remote computers.
-p Specifies optional password for user name. If you omit this
you will be prompted to enter a hidden password.
-s Run the remote process in the System account.
-u Specifies optional user name for login to remote
computer.
-v Copy the specified file only if it has a higher version number
or is newer on than the one on the remote system.
-w Set the working directory of the process (relative to
remote computer).
-x Display the UI on the Winlogon secure desktop (local system
only).
-priority Specifies -low, -belownormal, -abovenormal, -high or
-realtime to run the process at a different priority. Use
-background to run at low memory and I/O priority on Vista.
computer Direct PsExec to run the application on the remote
computer or computers specified. If you omit the computer
name PsExec runs the application on the local system,
and if you specify a wildcard (\\*), PsExec runs the
command on all computers in the current domain.
@file PsExec will execute the command on each of the computers listed
in the file.
program Name of application to execute.
arguments Arguments to pass (note that file paths must be
absolute paths on the target system).
psexec可以在远程机器上执行命令,下面是执行的命令
D:\Documents and Settings\huqunhui\psexec.exe \
\xxx.xxx.xxx.xxx -u username -p password net share my=I:\T2 /unlimited
相关文章推荐
- 如何使用citrix XenApp 发布远程共享文件夹,及其故障解决
- java使用smb 远程访问共享文件夹 密码有特殊字符 解决情况
- 使用OPENDATASOURCE访问远程机器上共享文件夹中的ACCESS、Excel数据库
- .net使用用户名和密码访问远程共享文件夹的两种方法
- 如何使用远程光盘在Mac或Windows上共享DVD/CD
- Windows访问远程共享文件夹
- java使用smb读取共享文件夹
- 使用JCIFS获取远程共享文件
- 用mount挂载远程Windows共享文件夹进行文件拷贝的方法
- Windows2008下共享文件夹的使用
- windows7使用Source insight上远程修改ubuntu共享内核源码
- 共享文件夹的创建与使用
- 使用mount命令在Ubuntu上挂接Windows的共享文件夹
- linux下使用远程共享目录
- virtualbox共享文件夹使用
- 使用 VirtualBox 实现与主机共享文件夹
- Linux如何共享远程文件夹(日志服查询的实现方法)
- xp上使用文件夹的共享和安全
- FMS3系列(六):使用远程共享对象(SharedObject)实现多人时时在线聊天(Flex | Flash)
- linux使用nfs、portmap服务共享远程磁盘的方法