Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy File Weird
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00288737
Message ID:
00288819
Views:
12
>This isn't working, is there a better/best way to do this with/out macro expansion?
>
>
>cPath = alltrim(ThisForm.cDBCPath1.Value)
>Local cShortPath, nSPathLen
>DECLARE INTEGER GetShortPathName IN KERNEL32 ;
>STRING lpszLongPath, STRING lpszShortPath, INTEGER cchBuffer
>cShortPath = Replicate(chr(0),512)
>nSPathLen = GetShortPathName(Fullpath(cPath), @cShortPath, 512)
>cShortPath = Left(cShortPath, nSPathLen)
>   	copy file sys(2023)+'\*.cdx' to &cShortPath

Using name expansion as shown below works fine:

  <b>COPY FILE (ADDBS(SYS(2023))+'*.cdx') TO (ADDBS(cShortPath) + '*.CDX')</b>


ADDBS() is native to VFP6, you can use the one in FoxTools prior to this.

>	copy file sys(2023)+'\*.cdx' to &cShortPath
>	copy file sys(2023)+'\*.dbc' to &cShortPath
>	copy file sys(2023)+'\*.dbf' to &cShortPath
>	copy file sys(2023)+'\*.dct' to &cShortPath
>	copy file sys(2023)+'\*.dcx' to &cShortPath
>	copy file sys(2023)+'\*.fpt' to &cShortPath
>
>
>Thanks for looking.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform