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




"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: C-Drive stem folders with duplicate website info???
    ... I created a sub-folder in my new main folder (HOA WEBSITE) for my .pub file, ... "downloads" on my C-Drive stem is causing the problem?? ... Rename you PDF files to match your links and place them in the DOWNLOADS ...
    (microsoft.public.publisher.webdesign)
  • Re: C-Drive stem folders with duplicate website info???
    ... I will Publish to the Web and place the files in the New "HOA" folder. ... I will place my .pdf files into the "DOWNLOADS" folder. ... Open your pub file using publisher and modify the links for your PDF ... until I had to go back and update the website by ...
    (microsoft.public.publisher.webdesign)
  • Re: C-Drive stem folders with duplicate website info???
    ... I then clicked on the index.htm inside of the new folder on my C-Drive stem, ... HOA WEBSITE, and up came a picture of the website when officially published. ... copied and pasted my four .pdf files into the "downloads" sub-folder. ...
    (microsoft.public.publisher.webdesign)
  • Re: C-Drive stem folders with duplicate website info???
    ... I will Publish to the Web and place the files in the New "HOA" folder. ... I will place my .pdf files into the "DOWNLOADS" folder. ... file would bring up a copy of my website, and that I could click on the .pdf ...
    (microsoft.public.publisher.webdesign)
  • Re: Convert Publisher file to a PDF File
    ... When I put the pdf files in a separate subfolder do I drag ... If you update the site and upload a new index_files ... folder, the old one may be overwritten which will mean your pdf file will be ... Publisher index.htm file and the index_files folder. ...
    (microsoft.public.publisher.webdesign)