/ Published in: SQL

This will run a bat file to get free space on a drive and write the results to a table.
Use script at http://snipplr.com/view/8331/calculate-free-space-on-drive/ as FreeSpace.bat
Use script at http://snipplr.com/view/8331/calculate-free-space-on-drive/ as FreeSpace.bat
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.tables WHERE TABLE_NAME = 'FreeSpace') DROP TABLE FreeSpace CREATE TABLE FreeSpace ( SpaceInMB VARCHAR(100) NULL ) INSERT INTO FreeSpace EXEC master..xp_CMDShell 'C:\Scripts\FreeSpace.bat'
Comments
