Solved

compying text file

Posted on 2002-03-29
5
184 Views
Last Modified: 2013-11-13
hi all i am wondring how can i protect my project when it played from the CD
i want to check up on the c:\ about text file named hossam that is exist on the cd when it cant be found on c:\ then i want to copy this file to the c:\ using my exe project & when i found the txt file on the c:\ so i can unload the form of my project
my question is how can i copy this file from the carent drive to the c:\ drive & how can i check it up
best regards
hossam
0
Comment
Question by:hmahfouzy
  • 3
5 Comments
 
LVL 3

Expert Comment

by:Bahnass
Comment Utility
about filecopy

filecopy "D:\hossam",c:\Hossam"

but what do u mean about protection ??
Eng. Ibraheem
0
 

Accepted Solution

by:
talluri_28 earned 200 total points
Comment Utility
hi hossam,

i am giving Code. i think it is use full to u.

Dim fso As New FileSystemObject

Public Sub Check_file()
 
   If (fso.FileExists("C:\hossam.txt")) = False then
       fso.CopyFile "c:\hossam.txt", "C:\hossam.txt"
   else
     'Unload Me 'Unload the form
     End 'Close the Application
   endif

End Sub


0
 

Expert Comment

by:talluri_28
Comment Utility
hi

u have to give the reference "SCRRUN.DLL" 'Microsoft Scripting Control'

jag
0
 
LVL 1

Author Comment

by:hmahfouzy
Comment Utility
may please explain where can i put this code in the declaration or else ?
thanx
0
 

Expert Comment

by:talluri_28
Comment Utility
Hi

If u want to use fso oject entire form u can declare in Declatation, other wise u can declare where u r using particular procedure

sorry previously i was written like this

fso.CopyFile "c:\hossam.txt", "C:\hossam.txt"

please modify that to

fso.CopyFile "D:\hossam.txt", "C:\hossam.txt"

tnx

jag


0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now