Sign in to follow this  
Followers 0
jtruono

Newbie Array Question

1 post in this topic

:whistle:

I am a newbie & tried to creat a script that backs up client lotus notes files. The first part of the script works but I can't get it to filecopy from the array. It seems to creat the location but wont read the destination.

Any help would be appreciated. I tried to coment it as much as possible.

If ProcessExists("nlnotes.exe") = 1 then; is notes running, if so have user close

Do

MsgBox(16, "Notes", "Please close Lotus Notes & Click OK to Continue?")

Until ProcessExists("nlnotes.exe") = 0

EndIf

$tdm=@MON&@MDAY&@HOUR&@MIN; make var with time day month for backup location in next line

$dc=DirCreate("c:\notesbac\"&$tdm&"\notes\data\mail\"); see above

$fp="c:\notesbac\"&$tdm&"\notes\data\mail\"; make location a var

$uname=InputBox("Notes Users Name?", "What Is The Users Name?", "LastF", "", -1, -1, 0, 0); check for user name for mail file

if FileExists ("d:\Notes\notes.ini") then ; sometimes we get a crashed drive & need to sister it to a working system

$drive="D:"; this would be the location of the crashed drive's mail file

else

$drive="C:"

endif

$bd=MsgBox(36, "Backup Drive", "Is The Source Drive "&$drive&" ?", ); askes if location is correct

if $bd = 7 then exit

Dim $n[9] [9]; sets up file location to get files & put files

$n[0] = "\Notes\notes.ini"

$n[1] = "\Notes\Data\bookmark.nsf"

$n[2] = "\Notes\Data\desktop5.dsk"

$n[3] = "\Notes\Data\gabdircat.nsf"

$n[4] = "\Notes\Data\headline.nsf"

$n[5] = "\Notes\Data\names.nsf"

$n[6] = "\Notes\Data\perweb.nsf"

$n[7] = "\Notes\Data\user.id"

$n[8] = "\Notes\Data\Mail\"&$uname&".nsf"

For $cnt = 0 TO 8; roll through array

$fe=FileExists($drive&$n[$cnt])

MsgBox(16, "pass # "&$cnt, "c:\notesbac\"&$tdm&"\") ; for tshooting

If $fe = 1 Then

MsgBox(16, $fe, "file exist"); for tshooting

MsgBox(16, "location ", $bul); for tshooting

$fc=FileCopy($drive&$n[$cnt],$dc1&$n[$cnt]&"\*.*")

If $fc = 0 Then

MsgBox(16, "ERROR"&$cnt, "Please contact the BSA or helpdedsk? Closing Script.")

Exit

EndIf

EndIf

Next

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