Solved

compying text file

Posted on 2002-03-29
5
189 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
ID: 6906148
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
ID: 6906473
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
ID: 6906483
hi

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

jag
0
 
LVL 1

Author Comment

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

Expert Comment

by:talluri_28
ID: 6909666
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 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