# How to create a folder using X++

**URL:** https://www.dynamicsuser.net/t/how-to-create-a-folder-using-x/29227
**Category:** Developer Forum
**Created:** [February 10, 2011, 12:11pm UTC](https://www.dynamicsuser.net/t/how-to-create-a-folder-using-x/29227 "2011-02-10T12:11:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![prashobkumar](https://sea1.discourse-cdn.com/flex023/user_avatar/www.dynamicsuser.net/prashobkumar/32/8224_2.png) [@prashobkumar](https://www.dynamicsuser.net/u/prashobkumar)
#### Post date: [February 10, 2011, 12:11pm UTC](https://www.dynamicsuser.net/t/how-to-create-a-folder-using-x/29227/1 "2011-02-10T12:11:06Z")

</div>

How to create a folder in a directory say D:\test using X++? the method should also check if the folder by that name exists or not.

Please advice.

---

<div class="post-metadata">

### Author: ![kollinaresh.k](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@kollinaresh.k](https://www.dynamicsuser.net/u/kollinaresh.k)
#### Post date: [February 10, 2011, 12:20pm UTC](https://www.dynamicsuser.net/t/how-to-create-a-folder-using-x/29227/2 "2011-02-10T12:20:55Z")

</div>

Hi Prashib,

try this…

static void FolderExists(Args \_args)  
{  
;  
if(WinAPI::folderExists(“E:\FolderName”))  
{  
info(“Exists”);  
}  
else  
{  
info(“Not Exists”);  
}  
}

Naresh Kolli

---

<div class="post-metadata">

### Author: ![prashobkumar](https://sea1.discourse-cdn.com/flex023/user_avatar/www.dynamicsuser.net/prashobkumar/32/8224_2.png) [@prashobkumar](https://www.dynamicsuser.net/u/prashobkumar)
#### Post date: [February 10, 2011, 12:31pm UTC](https://www.dynamicsuser.net/t/how-to-create-a-folder-using-x/29227/3 "2011-02-10T12:31:02Z")

</div>

Thanks Naresh
