如何使用PHP操作Windows文件和文件夹属性? [英] How to manipulate windows file and folder attribute with PHP?

查看:54
本文介绍了如何使用PHP操作Windows文件和文件夹属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是使用php设置或更改Windows文件和文件夹属性的任何可行方法吗?

Is this any possible way to set or change windows file and folder attribute with php?

我正在使用php在某些文件夹中创建desktop.ini文件.但我需要将其设为HSA-隐藏,系统文件,存档-另外,我需要将文件夹设置为只读,这是一个R标志.

I'm creating desktop.ini file in some folders with php. But I need to make it HSA - Hidden, System file, Archive - In addition I need to make folder read-only which is a R flag.

反正有PHP做吗?请帮我!

Is there anyway to do that with PHP ? please help me!

推荐答案

最后我找到了答案,

exec("attrib +r <any directory>");
exec("attrib +h +s +a desktop.ini");

这篇关于如何使用PHP操作Windows文件和文件夹属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆