|
-
Nov 24th, 2007, 08:38 AM
#1
Thread Starter
Fanatic Member
copy utility
I cannot find a file copy utility in VB 2008(VB.Net)
it would be the equivilant to:
SHFileOperation in VB 6
-
Nov 24th, 2007, 10:23 AM
#2
Lively Member
Re: copy utility
You can use one of these 2 options.
Code:
IO.File.Copy("sourceFileName as String", "destinationFileName as String")
Code:
My.Computer.FileSystem.CopyFile("sourceFileName as string", "destinationFileName as String")
-
Nov 24th, 2007, 12:39 PM
#3
Re: copy utility
Easiest wway to find stuff is to search the help files/msdn online or search the object browser.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 24th, 2007, 02:34 PM
#4
Thread Starter
Fanatic Member
Re: copy utility
 Originally Posted by Rykler
You can use one of these 2 options.
Code:
IO.File.Copy("sourceFileName as String", "destinationFileName as String")
Code:
My.Computer.FileSystem.CopyFile("sourceFileName as string", "destinationFileName as String")
can you give me an example of how to specify the files & folders?
-
Nov 24th, 2007, 07:29 PM
#5
Re: copy utility
If you want the user to select the source and destination paths then you would use an OpenFileDialog and SaveFileDialog respectively.
-
Nov 24th, 2007, 07:33 PM
#6
Thread Starter
Fanatic Member
Re: copy utility
no, it is only for program use, not a user feature in my App.
-
Nov 24th, 2007, 07:39 PM
#7
Re: copy utility
Then what more do you need? RonR has already shown you where to specify the source and destination paths. I assume you know what a file path looks like. If you need to specify paths relative to some specific folder then you'd need to let us know what folder that is. That said, you might want to take a look at Application.StartupPath, Environment.GetFolderPath and My.Computer.FileSystem.SpecialDirectories.
Last edited by jmcilhinney; Nov 24th, 2007 at 08:04 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|