58 lines
1.9 KiB
PowerShell
58 lines
1.9 KiB
PowerShell
#'Example for VBS '
|
|
#=====================================================
|
|
# login current user to current windream database
|
|
#=====================================================
|
|
# Dim Connect
|
|
# Dim Session
|
|
# Set Connect = WScript.CreateObject("Windream.WMConnect")
|
|
#'=====================================================
|
|
# create a session
|
|
#=====================================================
|
|
# MsgBox "Click OK to create a session. This may take some time."
|
|
# On Error Resume Next
|
|
# Set Session = WScript.CreateObject("Windream.WMSession")
|
|
# lErr = Err.Number if lErr <> 0 then
|
|
# MsgBox "Could not create session. Error: 0x" + CStr(Hex(lErr)) + " " + Err.Description
|
|
# Err.Clear else
|
|
# MsgBox " Session created. Click OK to login." end if
|
|
#'=====================================================
|
|
#' login session
|
|
#'=====================================================
|
|
# Connect.LoginSession(Session)
|
|
# lErr = Err.Number if lErr <> 0 then
|
|
# MsgBox "Login failed. Error: 0x" + CStr(Hex(lErr)) + " " + Err.Description
|
|
# Err.Clear end if LoggedIn = Session.aLoggedin
|
|
# If LoggedIn Then
|
|
# MsgBox "Login ok. " + vbCRLF + vbCRLF + "Click OK to close session"
|
|
# Else
|
|
# MsgBox "Login failed. " End If
|
|
#'=====================================================
|
|
#' logout
|
|
#'=====================================================
|
|
# set session = nothing
|
|
cls
|
|
|
|
$WMEntityDocument = 'WMEntityDocument'
|
|
$SourceFile = "e:\test.txt"
|
|
$TargetPath = "w:\Digital Data - Geschäftsprozesse\Manually\File\"
|
|
|
|
Try {
|
|
|
|
|
|
|
|
}
|
|
|
|
Catch {
|
|
|
|
}
|
|
$windreamConnect = New-Object -ComObject "Windream.WMConnect"
|
|
$windreamSession = New-Object -ComObject "Windream.WMSession"
|
|
|
|
$windreamConnect.LoginSession($windreamSession)
|
|
|
|
#IWMSession6 oIWMSession6 = (IWMSession6)oWMSession;
|
|
$WMObject = $windreamSession.GetNewWMObjectFSFromFile($WMEntityDocument,$TargetPath,0,$SourceFile)
|
|
$windreamSession.getnew
|
|
|
|
$test1 = Test-Path -Path "w:\system"
|
|
write-host $test1 |