Re: Moving a random file from the server to workstation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



This is awesome. The only thing it did not do is open the PDF that it
moved. Anyway of adding that in easily?


"Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
news:OnvOwVqOIHA.6108@xxxxxxxxxxxxxxxxxxxxxxx

"Sylvia" <nospam@xxxxxxxxx> wrote in message
news:uKEzV2pOIHA.4688@xxxxxxxxxxxxxxxxxxxxxxx
I have a shared folder on my server containing a few thousand PDF files.

I would like to set up a script that would move (so no copy remains) one
of the PDF files (it doesn't matter which one, they will all be moved
eventually using this process) from the server to a specific folder on
the local workstation and opens it.

In other words, I want this script to pick a random PDF file (the folder
will only contain PDFs) from a specific shared folder and move it to a
specific folder on the local workstation.

Does anyone have any suggestions on how to do this?

Thanks,
Glenn


You could use this batch file:
#@echo off
#set Source=D:\PDF Folder
#set Target=\\SomeMachine\Some Share\Some Folder
#
#for /F %%a in ('dir "%Source%\*.pdf" ^| find /i "file(s)"') do set
count=%%a
#
#set /a pick = 1 + %random% * count / 32767
#for /F "delims=" %%a in ('dir /b /a-d "%Source%" ^| more +%pick%') do
(set name=%%a& goto Move)
#
#:Move
#echo move "%Source%\%name%" "%Target%"

Please note:
- You must remove the # characters. Their only purpose is to
mark the start of each line.
- Do not retype this program - use copy/paste instead.
- Remove the word "echo" in the last line to activate the batch file.



.



Relevant Pages

  • Re: Relative HyperLinks
    ... I'm using MS Word 2007 and couldn't find an answer using Google. ... Contents where the reader can click on an item and it opens a ... corresponding pdf or chm file. ... into a folder and copy this to a CD that can be used on other machines. ...
    (microsoft.public.word.newusers)
  • Re: Outlook Express file association
    ... Chuck Moore wrote: ... .PDF is defined to open with the Acrobat reader. ... immediately opens it with the Acrobat reader. ... all you need to do is copy the folder in the Profiles folder under the Thunderbird folder. ...
    (microsoft.public.windowsxp.general)
  • Re: OT:Document Mangement
    ... of filing cabinets in the office by scanning them into PDF files. ... For instance The customer company folders were divided into Communications, ... Then when a current project became an order, was delivered and finished it only needed the folder moving to the Completed folder. ... Biggest problem we found was getting someone who had the balls to sit down and actually make a decision on where a particular pdf / doc actually needed ...
    (uk.rec.motorcycles)
  • Re: Opening Acrobat converted Document hangs MS Word 2003
    ... Some times after conversion from PDF to Word, ... In the folder list, locate and open the folder that contains the file. ... and it opens instantly, as does a PC running Office 2007. ...
    (microsoft.public.word.conversions)
  • Re: How to open a PDF document in new window use hyperlink?
    ... want show images thumbnails linked with PDF files, ... PDF will be opened in new window. ... The idea is always open PDF file in new window, ... // Opens PDF links in new windows ...
    (comp.lang.javascript)