Re: Moving a random file from the server to workstation



It will if the Acrobat installation creates an entry in the AppPath
registry key.


"Al Dunbar" <AlanDrub@xxxxxxxxxxxxxxxxxxx> wrote in message
news:u35%23vGVPIHA.4272@xxxxxxxxxxxxxxxxxxxxxxx

"Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
news:eUZ7TkrOIHA.292@xxxxxxxxxxxxxxxxxxxxxxx
Just add a line at the end to invoke Acrobat reader.

"c:\program files\..\...exe" "%Target%\%name%"

Wouldn't this work (i.e. without having to code in the location of the
reader):

start "" "%Target%\%name%"

/Al


"Sylvia" <nospam@xxxxxxxxx> wrote in message
news:edHjwRrOIHA.1204@xxxxxxxxxxxxxxxxxxxxxxx
The PDFs are being moved from the server to the workstation.
The script is meant to be run on the workstaiton. (I modified your
batch file to do this).

I want to open the (moved) file on the workstation.
The script is invoked by human action.

Thanks again.

"Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
news:%23aLbeBrOIHA.5720@xxxxxxxxxxxxxxxxxxxxxxx
You need to provide more details:
- Do the .pdf files reside on the server or on the workstation?
- Is the script meant to run on the server or on the workstation?
- Do you want to open the files on the server or on the workstation?
- How is the script invoked? By the Task Scheduler? By human action?


"Sylvia" <nospam@xxxxxxxxx> wrote in message
news:ucw5m0qOIHA.4688@xxxxxxxxxxxxxxxxxxxxxxx
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: SBS Add User wizard problem
    ... It turned out that the reason was script's folder ... The rest of settings are ok (it means they are like You said they ... Say I have a script on server which checks every 15 ...
    (microsoft.public.windows.server.sbs)
  • Re: permission errors
    ... setting up the NTBackup routine on his workstation or on the SBS server? ... Started when I wanted to make a backup of a folder on his workstation. ... the failure message was "Insufficient disk ...
    (microsoft.public.windows.server.sbs)
  • Re: CopyFolder logon script Windows 2003 Server
    ... > designated network share location. ... > also be our PDC running Win 2k3 server). ... > when testing this script it returns a 'folder does not exist'. ...
    (microsoft.public.scripting.wsh)
  • Scripting Agent not firing any events
    ... I've recently rebuilt my Exchange 5.5 ... Server on new hardware, and on W2K Server instead of NT4 Server. ... So I'm rebuilding a very simple public folder script, ...
    (microsoft.public.exchange.admin)
  • Re: Network shares cannot connect
    ... Changed value to 0 just waiting to re-boot the server and test logins. ... Workstation Name: - ... let's focus on the Users Shared Folder first. ... To check this permission, please click the Advanced button, select ...
    (microsoft.public.windows.server.sbs)