|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.thortech.xl.util.adapters.tcUtilPSTools
public class tcUtilPSTools
This is a wrapper class utilizing PSTools utility released by sysinternals.com. It based on executing a batch files remotely using psexec.exe provided by PSTools. It assumes this executable is in the system path. The paths and names of the associated batch files should be provided.
Constructor Summary | |
---|---|
tcUtilPSTools() Creates a new tcUtilPSTools object. |
|
tcUtilPSTools(java.lang.String admin, java.lang.String adminPwd, java.lang.String adminDomain, java.lang.String compName) Constructs tcUtilPSTools object with the following parameters |
Method Summary | |
---|---|
java.lang.String |
addUserToFolder(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String sharePath, java.lang.String user, java.lang.String permissions) Adds a user to have access to the directory (Security tab under folder properties) |
java.lang.String |
createDirectory(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String newDir) Creates a directory on the target machine |
java.lang.String |
createShare(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String shareName, java.lang.String sharePath, boolean hidden) Creates a share on the target machine |
java.lang.String |
deleteDirectory(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String dir) Deletes a directory on the target machine |
java.lang.String |
deleteShare(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String shareName) Deletes a share on the target machine |
static java.lang.String |
exec(java.lang.String command) Executes the specified string command in a separate process |
java.lang.String |
removeUserFromFolder(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String sharePath, java.lang.String user) Removes a user from having access to the directory (Security tab under folder properties) |
java.lang.String |
renameDirectory(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String existingDirPath, java.lang.String newDirName) Re-names an existing directory on the target machine RENAME [drive:][path]filename1 filename2. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public tcUtilPSTools()
public tcUtilPSTools(java.lang.String admin, java.lang.String adminPwd, java.lang.String adminDomain, java.lang.String compName)
admin
- Administrator login to use to access remote machineadminPwd
- Administrator password to use with the login to access remote machineadminDomain
- The domain under which the target computer iscompName
- Target computer nameMethod Detail |
---|
public java.lang.String createDirectory(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String newDir)
batchPath
- The absolute path of the batch file(without the '\' at the end) on local machine that is to be copied to target machine and executed there.batchFileName
- The name of the batch FilenewDir
- The absolute path of the directory to be createdpublic java.lang.String deleteDirectory(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String dir)
batchPath
- The absolute path of the batch file(without the '\' at the end) on local machine that is to be copied to target machine and executed there.batchFileName
- The name of the batch Filedir
- The absolute path of the directory to be deletedpublic java.lang.String renameDirectory(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String existingDirPath, java.lang.String newDirName)
batchPath
- The absolute path of the batch file(without the '\' at the end) on local machine that is to be copied to target machine and executed there.batchFileName
- The name of the batch FileexistingDirPath
- The absolute path of the directory to be deleted, ex: "c:\dirOld"newDirName
- The new directory name, ex: "dirNew"public java.lang.String createShare(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String shareName, java.lang.String sharePath, boolean hidden)
batchPath
- The absolute path of the batch file(without the '\' at the end) on local machine that is to be copied to target machine and executed there.batchFileName
- The name of the batch FileshareName
- Share name of the sharing directorysharePath
- Absolute path of the sharing directoryhidden
- true is the share is hidden, false otherwisepublic java.lang.String deleteShare(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String shareName)
batchPath
- The absolute path of the batch file(without the '\' at the end) on local machine that is to be copied to target machine and executed there.batchFileName
- The name of the batch FileshareName
- Share name (that is to be deleted) of the shared directorypublic java.lang.String addUserToFolder(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String sharePath, java.lang.String user, java.lang.String permissions)
batchPath
- The absolute path of the batch file(without the '\' at the end) on local machine that is to be copied to target machine and executed there.batchFileName
- The name of the batch FilesharePath
- The path of the directoryuser
- The user to add to the folder,... format: DOMAIN\User, Userpermissions
- The permissions to the folder of the user added, (format: ":F", ":C", ... for Full Control, Change, ... permissions)public java.lang.String removeUserFromFolder(java.lang.String batchPath, java.lang.String batchFileName, java.lang.String sharePath, java.lang.String user)
batchPath
- The absolute path of the batch file(without the '\' at the end) on local machine that is to be copied to target machine and executed there.batchFileName
- The name of the batch FilesharePath
- The path of the directoryuser
- The user to remove from the folder,... format: DOMAIN\User, Userpublic static java.lang.String exec(java.lang.String command)
command
- command to execute
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |