Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Move & Rename a file
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Stefano  
View profile  
 More options Nov 11 2009, 9:57 pm
Newsgroups: microsoft.public.scripting.vbscript
From: Stefano <Stef...@discussions.microsoft.com>
Date: Wed, 11 Nov 2009 13:57:01 -0800
Local: Wed, Nov 11 2009 9:57 pm
Subject: Move & Rename a file
Hi,
i'm stefano
i have a little problem....
i want move a file & rename.
may problem is manipulate the path file beacuse if i try this:

Dest = "C:\Folder02\File1.zip"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(Dest)
AbsolutePath = f.Path

AbsolutePath is empty (maybe beacause Dest not exist) i not have other idee
tx


    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.
Pegasus [MVP]  
View profile  
 More options Nov 11 2009, 10:13 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Wed, 11 Nov 2009 23:13:58 +0100
Local: Wed, Nov 11 2009 10:13 pm
Subject: Re: Move & Rename a file

"Stefano" <Stef...@discussions.microsoft.com> wrote in message

news:14C05974-DBB0-484D-8E8C-550D27F418F9@microsoft.com...

Your code is correct even though it lacks the final "file move" statement.
To make it robust you must check for the existence of the source file. You
should also test for the existence of the destination folder (not
implemented in the code fragment below). Here is a very basic method of
doing it:

sSource = "D:\Folder\File99.zip"
sDest = "C:\File1.zip"
Set oFSO = CreateObject("Scripting.FileSystemObject")
if not oFSO.FileExists(sSource) then WScript.Quit
oFSO.MoveFile sSource, sDest


    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.
Todd Vargo  
View profile  
 More options Nov 12 2009, 4:12 am
Newsgroups: microsoft.public.scripting.vbscript
From: "Todd Vargo" <tlva...@sbcglobal.netz>
Date: Wed, 11 Nov 2009 23:12:57 -0500
Local: Thurs, Nov 12 2009 4:12 am
Subject: Re: Move & Rename a file
Stefano wrote:
> Hi,
> i'm stefano
> i have a little problem....
> i want move a file & rename.
> may problem is manipulate the path file beacuse if i try this:

> Dest = "C:\Folder02\File1.zip"
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set f = fso.GetFile(Dest)
> AbsolutePath = f.Path

> AbsolutePath is empty (maybe beacause Dest not exist) i not have other

idee

If Dest does not exist, you should be receiving a "file not found" message.
Disable On Error Resume Next when debugging so error messages will be
displayed.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


    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.
Paul Randall  
View profile  
 More options Nov 13 2009, 4:38 am
Newsgroups: microsoft.public.scripting.vbscript
From: "Paul Randall" <paulr...@cableone.net>
Date: Thu, 12 Nov 2009 21:38:39 -0700
Local: Fri, Nov 13 2009 4:38 am
Subject: Re: Move & Rename a file

"Stefano" <Stef...@discussions.microsoft.com> wrote in message

news:14C05974-DBB0-484D-8E8C-550D27F418F9@microsoft.com...

The FSO object has path-parsing functions/methods that work with strings
that represent a file path or URL and perhaps UNC paths.  These
functions/methods don't care or test whether the paths actually exist.  Look
in the script56.chm help file for things like GetAbsolutePathName Method,
GetDriveName Method, GetExtensionName Method.  You might also be interested
in the BuildPath Method.

-Paul Randall


    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.
End of messages
« Back to Discussions « Newer topic     Older topic »

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