+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Script to check if file exists, if not copy from location in Coding and Web Development; I need a script to check if a .dll file exists on certain computers in the c:\windows\system32 folder. I need ...
  1. #1
    tosca925's Avatar
    Join Date
    Aug 2005
    Location
    Midlands
    Posts
    1,547
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    22

    Script to check if file exists, if not copy from location

    I need a script to check if a .dll file exists on certain computers in the c:\windows\system32 folder.

    I need the script to check if this file exists and if it does not then copy the file from the server eg \\server\folder\.dll

    I have tried one myself but cannot get it to work so need a little help or example.

    Preferably .vbscript

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,812
    Thank Post
    110
    Thanked 585 Times in 506 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Script to check if file exists, if not copy from location

    Why not use robocopy?

  3. #3

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,413
    Thank Post
    642
    Thanked 964 Times in 664 Posts
    Blog Entries
    2
    Rep Power
    327

    Re: Script to check if file exists, if not copy from location

    I'd probably map a spare network drive to the workstation's C$ share, and check for Z:\windows\system32\myfile.dll using FileSystemObject (FSO) FileExists() function.

  4. #4

    Join Date
    Feb 2006
    Location
    South Gloucestershire
    Posts
    23
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Script to check if file exists, if not copy from location

    try this in a cmd file, I tend to run this sort of thing as a shut down script (nobody time shutdowns but they scream if startup takes more than 1.5 seconds)

    IF NOT EXIST "c:\windows\system32\interesting.dll" COPY "\\server\share\interesting.dll" "c:\windows\system32\interesting.dll"

    beware of word wrap, that is all on one line and obviously you need to change file names to suit

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 17
    Last Post: 19th March 2010, 11:51 PM
  2. Location of DC/File Server?
    By park_bench in forum Wireless Networks
    Replies: 14
    Last Post: 16th August 2007, 09:02 PM
  3. Replies: 4
    Last Post: 25th December 2006, 09:15 PM
  4. VB Script ti check for folder and then copy contents to PC
    By tosca925 in forum How do you do....it?
    Replies: 4
    Last Post: 2nd October 2006, 08:15 PM
  5. Replies: 4
    Last Post: 23rd March 2006, 06:27 AM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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