Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

How to copy the file from one location to another location using vbscript?

This is a discussion on How to copy the file from one location to another location using vbscript? within the QTP forums, part of the Software Testing category; Hi Friends, Please let me know how we can do the copy operation of a file using vbscript code? Regards, pradeep...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 01-10-2008
Junior Member
 
Join Date: Jan 2008
Location: pune
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
pradeep_m is on a distinguished road
How to copy the file from one location to another location using vbscript?

Hi Friends,

Please let me know how we can do the copy operation of a file using vbscript code?


Regards,
pradeep
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-10-2008
Expert Member
 
Join Date: Oct 2007
Location: Mumbai
Posts: 355
Thanks: 4
Thanked 58 Times in 47 Posts
bizzzzzare will become famous soon enough
Re: How to copy the file from one location to another location using vbscript?

Hi,

Try this -

dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("c:\sourcefolder\anyfile.html") Then
filesys.CopyFile "c:\sourcefolder\anyfile.html", "c:\destfolder\"
End If


The FileSys.CopyFile method should work. Just remember to pass the Source and Destination paths correctly.

Cheers...
__________________
Regards,

V.Umesh Krishnan
QA Consultant
Reply With Quote
  #3 (permalink)  
Old 01-10-2008
Expert Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 115
Thanks: 1
Thanked 19 Times in 15 Posts
rajaputra is on a distinguished road
Re: How to copy the file from one location to another location using vbscript?

Hi Pradeep,

Try fhis,
This is for Copying a file (located in desktop) into a folder (located into desktop)

Set Shell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
SourceDesktopPath = Shell.SpecialFolders("Desktop") + "\rajaputra.txt" 'we can use either & or + to concotinate the strings
DestinationDesktopPath = Shell.SpecialFolders("Desktop") + "\Destination\"
FSO.CopyFile SourceDesktopPath, DestinationDesktopPath

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Arunsingh Rajaputra
Software Test Engineer
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Location of compressed old files. nitin_gupta Windows 1 11-27-2007 07:36 AM
File location BabieTech Windows 3 08-17-2007 07:49 PM
what is the location of the PGA Geek_Guest Oracle 1 05-25-2007 07:16 AM
Copy test cases associated with requirements to new location Geek_Guest Test Director 2 05-14-2007 05:19 AM
Functions were stored in different location. tarunpandey4 QTP 2 04-20-2007 03:09 PM


All times are GMT -4. The time now is 01:40 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved