Darren,
Thanks Much!
FSO worked great, I used the CopyFile function so the original files
remained in their folder.
I'm going to do some more research on the FSO object as I've not heard of it
prior and maybe I'll be able to use it elsewhere.
Thanks again.
Scan
mnamefile = pdf_loc_path + &mdamname + ".PDF"
MPATHFILE = packet_path + Upper(tattoo) + ".PDF"
If File(mnamefile)
= Strtofile(mnamefile,mnamefile) && Filename
on disk ="test_text.txt"
oFSO = Createobject("scripting.filesystemobject")
*ofso.MoveFile(mnamefile,MPATHFILE) && Filename on
Disk = "Test_text.txt"
oFSO.CopyFile(mnamefile,MPATHFILE) && Filename on
Disk = "Test_text.txt"
Endif
Endscan
James E Harvey
M.I.S.
Hanover Shoe Farms, Inc.
www.hanoverpa.com
office: 717-637-8931
cell: 717-887-2565
fax: 717-637-6766
-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Darren
Sent: Thursday, August 29, 2013 3:41 PM
To: [email protected]
Subject: RE: How to "FORCE" uppercase filename
James
I believe the FSO is your friend in this case. Give it a try. If not let me
know and I 'll dig through my framework and find another method I used
(Can't recall exactly but involves some API stuff and definitely works)
FSO is easier though - I have confirmed below on my system - I'm running
Windows 7 x64 Ultimate
Cheers
Darren
=STRTOFILE("sometext","c:\temp\test_text.txt") && Filename on disk =
"test_text.txt"
oFSO = CREATEOBJECT("scripting.filesystemobject")
ofso.MoveFile("c:\temp\test_text.txt", "c:\temp\Test_text.txt") && Filename
on Disk = "Test_text.txt"
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of James
Harvey
Sent: Friday, 30 August 2013 5:23 AM
To: [email protected]
Subject: RE: How to "FORCE" uppercase filename
Darren,
I first run a process that confirms there is a pdf for each record (horse)
in the table, then the code below is run to copy the files from one folder
to another with the new name.
The convention for naming the pdf's is if the horse is a yearling they use
the yearling's dam's name for the pdf, and if it is NOT a yearling they use
the actual name of the horse.
***m_copy_rename
With Thisform.stcntgroup
pdf_loc_path = Alltrim(.sttxtpdfloc.Value)
packet_path = Alltrim(.sttxtpacketpath.Value)
If .Hstxtfhip.Value = " "
mhips = " (hip_no <> ' ' or hip_no = ' ') "
Else
mhips = " (hip_no >= .Hstxtfhip.value and hip_no <=
.Hstxtlhip.value) "
Endif
With .stcmbtype
Do Case
Case Empty(.Value)
Messagebox("You must select a 'Type', please try
again.",16,"Notice")
.SetFocus
Return .F.
Case .Value = "A"
mtype = " (type_horse <> ' ' or type_horse = ' ') "
Case .Value = "B"
mtype = " type_horse = 'B' "
Case .Value = "R"
mtype = " type_horse = 'R' "
Case .Value = "S"
mtype = " type_horse = 'S' "
Case .Value = "W"
mtype = " type_horse = 'W' "
Case .Value = "Y"
mtype = " type_horse = 'Y' "
Case .Value = "M"
mtype = " type_horse <> 'Y' "
Case .Value = "P"
mtype = " type_horse = 'B' or (type_horse = 'R' and
sex = 'M') "
Otherwise
mtype = " (type_horse <> ' ' or type_horse = ' ') "
Endcase
If .Value <> "Y"
mdamname = " ALLTRIM(NAME) "
Else
mdamname = " ALLTRIM(DAM1) "
Endif
Endwith
If .stcmbgait.Value <> ' '
mgait = " gait = .Stcmbgait.value "
Else
mgait = " (gait <> ' ' or gait = ' ') "
Endif
If .stcmbsex.Value <> ' '
msex = " sex = .Stcmbsex.value "
Else
msex = " (sex <> ' ' or sex = ' ') "
Endif
If .Stcmbsire.Value <> ' '
msire = " sire1 = .Stcmbsire.value "
Else
msire = " (sire1 <> ' ' or sire1 = ' ') "
Endif
If .Stcmbcon.Value <> ' '
MCONS = " cons_no = .Stcmbcon.value "
Else
MCONS = " (cons_no <> ' ' or cons_no = ' ') "
Endif
Select ;
Name, ;
tattoo, ;
sex, ;
gait, ;
sire1, ;
dam1, ;
sire2, ;
cons_no, ;
hip_no, ;
type_horse ;
From ;
(msalefile) ;
Where ;
&mhips ;
And ;
&mtype ;
And ;
&mgait ;
And ;
&msex ;
And ;
&msire ;
And ;
&MCONS ;
Order By hip_no ;
Into Cursor pedtemp
Select pedtemp
*******************************************************************
Scan
mname = &mdamname + ".PDF"
mnamefile = pdf_loc_path + &mdamname + ".PDF"
MPATHFILE = packet_path + "_" + Upper(tattoo) + ".PDF"
If File(mnamefile)
*Copy File UPPER(mnamefile) To (MPATHFILE) *Copy File UPPER(mnamefile) To
(packet_path)+ UPPER(tattoo) + ".PDF"
Copy File Upper(mnamefile) To (packet_path) + tattoo
+ ".PDF"
Endif
ENDSCAN
*******************************************************************
Messagebox("Transfer complete, check the destination folder to
confirm transfer.",0,"Notice")
Endwith
Thisform.Refresh
James E Harvey
M.I.S.
Hanover Shoe Farms, Inc.
www.hanoverpa.com
office: 717-637-8931
cell: 717-887-2565
fax: 717-637-6766
-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Darren
Sent: Thursday, August 29, 2013 3:05 PM
To: [email protected]
Subject: RE: How to "FORCE" uppercase filename
James - how are you copying and renaming the files?
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of James
Harvey
Sent: Friday, 30 August 2013 5:01 AM
To: [email protected]
Subject: RE: How to "FORCE" uppercase filename
Looks like the best option to try is the first one, otherwise I'd have to
edit everyone's registry?
James E Harvey
M.I.S.
Hanover Shoe Farms, Inc.
www.hanoverpa.com
office: 717-637-8931
cell: 717-887-2565
fax: 717-637-6766
-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of M Jarvis
Sent: Thursday, August 29, 2013 2:55 PM
To: [email protected]
Subject: Re: How to "FORCE" uppercase filename
On Thu, Aug 29, 2013 at 11:31 AM, James Harvey <[email protected]>
wrote:
> Trying to copy pdf files from one folder to another and in the process
> "rename" the files being copied.
>
I haven't tested it, but does this help?
http://www.techsupportalert.com/content/how-force-your-windows-file-and-fold
er-names-have-case-you-want.htm
--
Matt Jarvis
Eugene, Oregon USA
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.