Solved

compying text file

Posted on 2002-03-29
5
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

688 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