Sign in to follow this  
Followers 0
1bobby

Write to CD

2 posts in this topic

#1 ·  Posted (edited)

The following code is a sample of how I am trying to create a directory, biased on the date, and then writing a backup file to a CD for a weekly backup. All the code works down to sending it to the CD. If I do the steps in manually it seems to work, as far as putting the file to the CD and creating the directory. Haven't tried to write the CD yet. Is there another approach to this I am missing? Thanks.

Code:

$LongDate = (@year & @mon & @mday) ; Setup date constant for folder name

MsgBox( 4096, "Day of Week", "Today is: " & $LongDate, 10) ;Display the folder name

Sleep(500)

DirCreate("f:\" & $LongDate) ;This will change to Ken's d-drive which is his CD

sleep(5000)

FileCopy("c:\DPSIBU\WEEKLY.bkf", "f:\" & $LongDate , 9) ; this is for testing on bobby's computer for ken e will output

sleep(5000)

Don't think the long sleeps are necessary. I forgot to say that if I change the f: drive to the c: drive it will work just fine.

Edited by 1bobby

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The following code is a sample of how I am trying to create a directory, biased on the date, and then writing a backup file to a CD for a weekly backup. All the code works down to sending it to the CD. If I do the steps in manually it seems to work, as far as putting the file to the CD and creating the directory. Haven't tried to write the CD yet. Is there another approach to this I am missing? Thanks.

Code:

$LongDate = (@year & @mon & @mday) ; Setup date constant for folder name

MsgBox( 4096, "Day of Week", "Today is: " & $LongDate, 10) ;Display the folder name

Sleep(500)

DirCreate("f:\" & $LongDate) ;This will change to Ken's d-drive which is his CD

sleep(5000)

FileCopy("c:\DPSIBU\WEEKLY.bkf", "f:\" & $LongDate , 9) ; this is for testing on bobby's computer for ken e will output

sleep(5000)

Don't think the long sleeps are necessary.

You don't need the sleeps at all and You don't nned The DirCreate() either (because you used 9 as the flag for FileCopy())

I would also try to make an early decision on how you plan on burning the CD.

The easiest is to get the path to the CD Burning folder from the registry and copy to that

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

That's the method used by Windows that gives the standard "You have files waiting....." message.

The other method would be to use cdburn.exe if you have it. I have it in my system32 folder but I don't know off the top where I put my directions for using it so you might have to Google that.

Forgot to mention that the value you need in there is "CD Burning"

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0