Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:02:24+00:00 2026-05-24T00:02:24+00:00

Good afternoon, I wish to have a script that will look for all files

  • 0

Good afternoon, I wish to have a script that will look for all files with the name pattern LCP-??? and/or FSA-??? in c:\streetweeper and copy them to D:\java\temp\sz-files.
This script will run on startup.

I found a vbscript which has very similar functionality yet it uses a text file to read the files which need to be copied. can anyone help me transform this script to function as described above?

thanks for your time, the script is below:

Option Explicit

'The source path for the copy operation.
Const strSourceFolder = "c:\streetweeper"

'The target path for the copy operation.
Const strTargetFolder = "D:\java\temp\sz-files"

'The list of files to copy. Should be a text file with one file on each row. No paths -    just file name.
Const strFileList = "C:\filelist.txt"

'Should files be overwriten if they already exist? TRUE or FALSE.
Const blnOverwrite = FALSE

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

Const ForReading = 1
Dim objFileList
Set objFileList = objFSO.OpenTextFile(strFileList, ForReading, False)

Dim strFileToCopy, strSourceFilePath, strTargetFilePath
On Error Resume Next
Do Until objFileList.AtEndOfStream
'Read next line from file list and build filepaths
strFileToCopy = objFileList.Readline
strSourceFilePath = objFSO.BuildPath(strSourceFolder, strFileToCopy)
strTargetFilePath = objFSO.BuildPath(strTargetFolder, strFileToCopy)

'Copy file to specified target folder.
Err.Clear
objFSO.CopyFile strSourceFilePath, strTargetFilePath, blnOverwrite
If Err.Number = 0 Then
    'File copied successfully

Else
    'Error copying file
    Wscript.Echo "Error " & Err.Number & " (" & Err.Description & "). Copying " & strFileToCopy
End If
Loop
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:02:26+00:00Added an answer on May 24, 2026 at 12:02 am

    in copystuff.cmd

    REM The following statement will have no effect if the directory does exist.
    mkdir D:\java\temp\sz-files
    
    XCOPY /Y /E c:\streetweeper\LCP-*.* D:\java\temp\sz-files
    
    IF ERRORLEVEL 0 GOTO COPYNEXT
    GOTO END
    
    :COPYNEXT
    XCOPY /Y /E c:\streetweeper\FSA-*.* D:\java\temp\sz-files
    
    IF ERRORLEVEL 0 GOTO DELETEFILES
    GOTO End
    
    :DELETEFILES
    DEL /Q LCP-*.*
    DEL /Q FSA-*.*
    
    :End
    

    OR

    REM The following statement will have no effect if the directory does exist.
    mkdir D:\java\temp\sz-files
    
    MOVE /Y C:\StreetSweeper\LCP-*.* D:\Java\Temp\sz-files
    MOVE /Y C:\StreetSweeper\FSA-*.* D:\Java\Temp\sz-files
    

    Stuff in the startup folder of your start menu and you’re good to go!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good afternoon all. I have a page that displays data in a gridview based
Good Afternoon All, I have a table inside a div. The div has a
Good afternoon. Before I begin my explanation, I have had a look at other
Good afternoon people's I have built a jquery plugin that I use on my
Good afternoon all Here is my scenario: I have user controls within a master
Good afternoon, It is a well known fact that when dealing with large files
Good Afternoon, I've written a very basic stored procedure that will be used to
Good afternoon, I have a web query in Excel 2002 going against a web
Good afternoon, with all the buzz around the iPhone / AppStore etc, I felt
Good morning, I am the developer of a medium sized PDA application that will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.