# How to open folders and copy files?

**URL:** <https://forums.solar2d.com/t/how-to-open-folders-and-copy-files/347618>\
**Category:** Win32 Desktop\
**Created:** [May 20, 2018, 1:25pm UTC](https://forums.solar2d.com/t/how-to-open-folders-and-copy-files/347618 "2018-05-20T13:25:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![284672641](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/2/71c47a/32.png) [@284672641](https://forums.solar2d.com/u/284672641)\
**Post date:** [May 20, 2018, 1:25pm UTC](https://forums.solar2d.com/t/how-to-open-folders-and-copy-files/347618/1 "2018-05-20T13:25:12Z")

</div>

I can not create new folders and copy files by using the following commands:  
–os.execute (“MD c:\qqq”))  
–os.execute (“move C:\Users\Administrator\Desktop\ts.so c:\qqq”)  
What permissions do need to set up?  
Or I can open the folder qqq in Win32 and display the files in the folder to the user. My program is a picture downloader, download pictures from my server, download and open the folder for users to copy the mobile and downloaded pictures.

---

<div class="post-metadata">

**Author:** ![davebollinger](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/e79b87/32.png) [@davebollinger](https://forums.solar2d.com/u/davebollinger)\
**Post date:** [May 20, 2018, 3:17pm UTC](https://forums.solar2d.com/t/how-to-open-folders-and-copy-files/347618/2 "2018-05-20T15:17:00Z")

</div>

first you’ll need to escape your slashes, fe “md c:\qqq”

THEN you can see if you might also have permission issues

(THEN rewrite it with [lfs](https://docs.coronalabs.com/api/library/lfs/index.html)&nbsp;because it’s more robust than os for such work)

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [May 20, 2018, 3:40pm UTC](https://forums.solar2d.com/t/how-to-open-folders-and-copy-files/347618/3 "2018-05-20T15:40:59Z")

</div>

I think you’d be better off using the&nbsp;[SSK2](https://roaminggamer.github.io/RGDocs/pages/SSK2/)–\>&nbsp;[files.\* lib](https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/):  
&nbsp;  
This attempt:&nbsp;&nbsp;

```
os.execute ("MD c:\qqq")) os.execute ("move C:\Users\Administrator\Desktop\ts.so c:\qqq\")

```

&nbsp;  
Becomes this success (works equally well on Windows and OS X, except for your C:\ drive.&nbsp; That would be different) :

```
local folder = ssk.files.desktop.getDrivePath("c:/qqq") ssk.files.util.mkdir( folder ) local src = ssk.files.desktop.getDesktopPath("ts.so") local dst = folder .. "/ts.so" ssk.files.util.mvFile( src, dst )

```

–[https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#desktop-os-x-and-windows-sskfilesdesktop](https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#desktop-os-x-and-windows-sskfilesdesktop)

---

<div class="post-metadata">

**Author:** ![davebollinger](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/e79b87/32.png) [@davebollinger](https://forums.solar2d.com/u/davebollinger)\
**Post date:** [May 20, 2018, 3:17pm UTC](https://forums.solar2d.com/t/how-to-open-folders-and-copy-files/347618/4 "2018-05-20T15:17:00Z")

</div>

first you’ll need to escape your slashes, fe “md c:\qqq”

THEN you can see if you might also have permission issues

(THEN rewrite it with [lfs](https://docs.coronalabs.com/api/library/lfs/index.html)&nbsp;because it’s more robust than os for such work)

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [May 20, 2018, 3:40pm UTC](https://forums.solar2d.com/t/how-to-open-folders-and-copy-files/347618/5 "2018-05-20T15:40:59Z")

</div>

I think you’d be better off using the&nbsp;[SSK2](https://roaminggamer.github.io/RGDocs/pages/SSK2/)–\>&nbsp;[files.\* lib](https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/):  
&nbsp;  
This attempt:&nbsp;&nbsp;

```
os.execute ("MD c:\qqq")) os.execute ("move C:\Users\Administrator\Desktop\ts.so c:\qqq\")

```

&nbsp;  
Becomes this success (works equally well on Windows and OS X, except for your C:\ drive.&nbsp; That would be different) :

```
local folder = ssk.files.desktop.getDrivePath("c:/qqq") ssk.files.util.mkdir( folder ) local src = ssk.files.desktop.getDesktopPath("ts.so") local dst = folder .. "/ts.so" ssk.files.util.mvFile( src, dst )

```

–[https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#desktop-os-x-and-windows-sskfilesdesktop](https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/#desktop-os-x-and-windows-sskfilesdesktop)
