[MSSQL]xp_cmdshell 查看磁盘空间

EXEC xp_cmdshell 'wmic logicaldisk get freespace,caption | findstr C';

<class 'pyodbc.Row'>
('C:       25581236224  \r', )

 查看所有磁盘可用空间

Exec master.dbo.xp_fixeddrives;

 

 获取数据库、日志文件路径

select filename from student.dbo.sysfiles;

 

posted @ 2020-02-14 00:30  LeoShi2020  阅读(312)  评论(0编辑  收藏  举报