Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folder copying question? 2

Status
Not open for further replies.

krappleby025

Programmer
Sep 6, 2001
347
NL
I have a folder on one of my harddrives

e:/Group/TTL

now, i need to make an exact copy of the TTL folder and ALL contents,
But rename the folder to for example BRF...

so i would end up with

e:/Group/TTL
and
e:/Group/BRF

I am not an experienced programmer, and would appreciate some help...

Also inside the folder their is a txt file

e:/Group/TTL/includes/config.txt

i need to open this to edit it and then save it again

thanks

any help would be appreciated, even a link to get this information so that i can work on it..
Thank you
 
Thanks for your info.. Do you now have a link, for the following....

Delete a text file
and to create a text file
and add information to it

or

just to change the info... here is what is in the text file

<%
Memberstable = &quot;TTLMembers&quot;
TransactionTable = &quot;TTLTransactions&quot;
AdminLogin = &quot;*******&quot;
AdminPassword = &quot;*********&quot;
Group = &quot;TTL&quot;
%>

i do not mind redoing the text file completely adding new lines, after deleting previous...

thanks
 
You could open the file with overwrite flag set, this will destroy the contents of any like named file and allow you to write to it from scratch:
Code:
set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
set file = fs.CreateTextFile(&quot;E:/Group/TTl/mytextfile.txt&quot;, true, false)

Then just use the file.write or file.writeline methods to write text back to it and then close the file.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
The link to the code for planet-source-safe show how to create a file and add text to it.

If you look at the code in the file copy url, use the filesys.deletefile method.

Thanks,

Gabe
 
Thanks all this is really helping.. i have managed to solve the folder copy problem, and am working on the text file... i have this

Groupid = &quot;testfolder&quot; ' (ps. these are just
Adminpass = &quot;testing123&quot; ' (to enable me to set up the file
set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
set file = fs.CreateTextFile(&quot;E:/GroupMLM/&quot; & Groupid & &quot;/config.txt&quot;, true, false)
file.writeline(&quot;Memberstable = &quot;&quot; & Groupid & &quot;Members&quot;&quot;)
file.writeline(&quot;TransactionTable = &quot;&quot; & Groupid & &quot;Transactions&quot;&quot;)
file.writeline(&quot;AdminLogin = &quot;&quot;admin&quot;&quot;)
file.writeline(&quot;Adminpassword = &quot;&quot; & adminpass & &quot;&quot;&quot;)
file.writeline(&quot;Group = &quot;&quot; & Groupid & &quot;&quot;&quot;)
file.close
set file = nothing

it is causing an error, what is wrong with it....any ideas

displaying page cannot be displayed... Error on the page
 
i just noticed, lol.... I am using (& q u o t ;) and not &quot; some times its just placed them as &quot;
 
Sorry,


OK I have managed to solve that last problem
it was due to their being to many &quot; in one of the lines HOWEVER

when i have checked the txt file.. it looks like this


Memberstable = &quot;whatever&quot;

HOWEVER Where their should actually be a &quot; their is only a & quot;
 
Not sure what your referencing, the problem i see up above (that you may have already solved) is:
file.writeline(&quot;Memberstable = &quot;&quot;&quot; & Groupid & &quot;Members&quot;&quot;&quot;)
file.writeline(&quot;TransactionTable = &quot;&quot;&quot; & Groupid & &quot;Transactions&quot;&quot;&quot;)
file.writeline(&quot;AdminLogin = &quot;&quot;admin&quot;&quot;&quot;)
file.writeline(&quot;Adminpassword = &quot;&quot;&quot; & adminpass & &quot;&quot;&quot;)
file.writeline(&quot;Group = &quot;&quot;&quot; & Groupid & &quot;&quot;&quot;&quot;)

That should solve any problems with the string concatenations, I think I got them all but you may want to look them back over to be sure
-tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
thanks, however, you missed my point....

where you have highlighted the &quot; above, you should have highlighted the second on each three

However

The problem is... This is a html site, and translates & quot; to &quot; the second &quot; in every three, is printed on the text file as & quot; and not as &quot; like i need

now do you get my meaning.. the text file looks like

tablemembers = & quot;ttlmembers& qout;
tabletransactions = & quot;ttltransaction& qout;

etc
etc

any ideas how i can do this, it should look like

tablemembers = &quot;ttlmembers&quot;
tabletransactions = &quot;ttltransaction&quot;

thanks
 
Right the double double quotes in ASP are the escape character for quotes, therefore if you have a string named myString and you assigne it the value:
myString = &quot;&quot;&quot;ttlmembers&quot;&quot;&quot;
Then the value that would get written if you write it to the screen is: &quot;ttlmembers&quot;
This is the same as saving it to the file.
The first and last quote are to declare the string, the inside pairs resolve to a single set of quotes that are part of the string.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
ok,

her is the script i am using

file.writeline(&quot;<%&quot;)
file.writeline(&quot;Memberstable = &quot;&quot; & Groupid & &quot;Members&quot;&quot;)
file.writeline(&quot;TransactionTable = &quot;&quot; & Groupid & &quot;Transactions&quot;&quot;)
file.writeline(&quot;AdminLogin = &quot;&quot;admin&quot;&quot;)
file.writeline(&quot;Adminpassword = &quot;&quot; & adminpass & &quot;&quot;)
file.writeline(&quot;Group = &quot;&quot; & Groupid & &quot;&quot;)
file.writeline(&quot;%>&quot;)
file.close

what is wrong with it... It needs to display

<%
Memberstable = &quot;ttlmembers&quot;
transactiontable = &quot;ttltransactions&quot;
adminlogin = &quot;*****&quot;
adminpassword = &quot;********&quot;
group = &quot;ttl&quot;
%>

But it doesnt

HELPPPPPP???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top