Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Move n files sort by Filename
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mayayana  
View profile  
 More options Nov 6 2009, 3:14 pm
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
desitnation file exists, so it's a good idea to do:

If FSO.FileExists("C:\there\file1.txt") Then FSO.DeleteFile
"C:\there\file1.txt", True

FSO.MoveFile "C:\here\file1.txt", "C:\there\file1.txt"

  You can find all of this in the Windows Script
documentation.
  If you need to first find the files that's a different
matter, but from your post it sounds like that's not
an issue.

--
--

Bals <balamurugan.mr....@gmail.com> wrote in message

news:b7cdd336-ef14-42bb-8cc5-979ecd986b49@k19g2000yqc.googlegroups.com...
> 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
> folder
> 1Filename.txt
> 2Filename.txt
> 3Filename.txt
> 4Filename.txt
> 5Filename.txt

> Please give me a sample script for this


    Forward  
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.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google