Newsgroups: microsoft.public.scripting.vbscript
From: "mayayana" <mayaXXy...@rcXXn.com>
Date: Fri, 6 Nov 2009 10:14:44 -0500
Local: Fri, Nov 6 2009 3:14 pm
Subject: Re: Move n files sort by Filename
You didn't explain what makes those files "first".
If they're recognizable by name then you can just use MoveFile. Are you familiar with the FileSystemObject? It provides a number of file handling functions. First create the object: Set FSO = CreateObject("Scripting.FileSystemObject") ' The MoveFile method is like this: FSO.MoveFile "C:\here\file1.txt", "C:\there\file1.txt" However, MoveFile is prone will error out if the If FSO.FileExists("C:\there\file1.txt") Then FSO.DeleteFile FSO.MoveFile "C:\here\file1.txt", "C:\there\file1.txt" You can find all of this in the Windows Script -- > I have many files in a folder - I need to move only first 5 files
> another folder sort by filename > ie in Source folder i have > 1Filename.txt > 2Filename.txt > 3Filename.txt > 4Filename.txt > 5Filename.txt > 6Filename.txt > 7Filename.txt > 8Filename.txt > 9Filename.txt > I need to move only FIRST 5 files sort by Filename to destination > Please give me a sample script for this You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||