Yes, but they are always lowercase as I pointed out

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: ProfoxTech <profoxtech-boun...@leafe.com> on behalf of Richard Kaye 
<rk...@invaluable.com>
Sent: Tuesday, May 31, 2022 4:41:12 PM
To: profoxt...@leafe.com <profoxt...@leafe.com>
Subject: RE: A better way to create directories?

I did this:

MKDIR test1\test2

And VFP happily created both folders. I tried from both the root of C as well 
as starting from a sub-folder.

--

rk

From: ProfoxTech <profoxtech-boun...@leafe.com> On Behalf Of Paul Newton
Sent: Tuesday, May 31, 2022 11:32 AM
To: profoxt...@leafe.com
Subject: A better way to create directories?

Hi all

I hope the following might be useful (I apologise if this is "old hat"
for some of you).  I wanted to create C:\Folder1\Folder2 when Folder1
does not exist.

It is possible to do this using MKDIR but the created folders are in
lowercase.

You cannot do this with the CreateDirectory API, nor with
Scripting.FileSystemObject.

Here is the solution:

Function MDEx(tcFolder)
* tcFolder must be a full path including drive letter
DECLARE INTEGER SHCreateDirectory In Shell32 INTEGER hwnd, STRING Path
Local nResult
* Path must be UNICODE
nResult = SHCreateDirectory(0, StrConv(tcFolder,5))
Return nResult && 0 = Success

Possible error codes are:
ERROR_BAD_PATHNAME (161) : tcFolder was a relative path
ERROR_FILENAME_EXCED_RANGE (206) : Path too long
ERROR_FILE_EXISTS (80) or ERROR_ALREADY_EXISTS (183) : The directory
already exists
ERROR_CANCELLED (1223) : Cancelled by user

Paul Newton

--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/lo6p265mb6491c3336da6abdd2cb3a793ae...@lo6p265mb6491.gbrp265.prod.outlook.com
** 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.

Reply via email to