+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, Traversing directories and print files from the client over WebDav ? in Coding and Web Development; Hi All, I'd like to know if it is possible Using Powershell 2.0 to traverse directory and print files on ...
  1. #1

    Join Date
    May 2009
    Location
    Sydney
    Posts
    282
    Thank Post
    322
    Thanked 3 Times in 3 Posts
    Rep Power
    11

    Question Traversing directories and print files from the client over WebDav ?

    Hi All,

    I'd like to know if it is possible Using Powershell 2.0 to traverse directory and print files on the client side printer over WebDAV protocol ?

    i got the below powershell script it works great over the shared network drive but how to actually modify and use it in WebDav folders ?

    the scenario is like this: i have a directories in the server which has got multiple PDF files and the client would like to print it using the printer on their machine.

    Thanks.
    Last edited by albertwt; 21st September 2010 at 07:38 AM.

  2. #2

    Join Date
    May 2009
    Location
    Sydney
    Posts
    282
    Thank Post
    322
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    Printing script which works for shared network folder but not WebDAV

    function print-file($file) {
    begin {
    function internal-printfile($thefile) {
    if ($thefile -is [string]) {$filename = $thefile }
    else {
    if ($thefile.FullName -is [string] ) { $filename = $THEfile.FullName }
    }
    $start = new-object System.Diagnostics.ProcessStartInfo $filename
    $start.Verb = "print"
    [System.Diagnostics.Process]::Start($start)
    }

    if ($file -ne $null) {
    $filespecified = $true;
    internal-printfile $file
    }
    }
    process{if (!$filespecified) { write-Host process ; internal-printfile $_ } }
    }

    #dir *.pdf -r | print-file
    Script for testing the webdav protocol in use, it returns True
    function Test-WebDav ()
    {
    param ( $Url = "$( throw 'URL parameter is required.')" )
    $xhttp = New-Object -ComObject msxml2.xmlhttp
    $xhttp.open("OPTIONS", $url, $false)
    $xhttp.send()
    if ( $xhttp.getResponseHeader("DAV") ) { $true }
    else { $false }
    }

    Test-WebDav "http://vmws02.domain.com/"

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 6
    Last Post: 12th September 2011, 10:24 AM
  2. WebDav Sync Client
    By russdev in forum Windows
    Replies: 0
    Last Post: 29th June 2010, 10:51 AM
  3. Replies: 11
    Last Post: 6th May 2009, 11:07 PM
  4. Replies: 4
    Last Post: 25th June 2007, 01:33 PM
  5. Webdav web client, force webfolder view?
    By Quackers in forum Web Development
    Replies: 2
    Last Post: 26th March 2006, 06:05 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •