2

I know that Windows Sidebar Gadget API provides functionality beyond normal Javascript capabilities. Does it manipulate files? How?

I didn't find how to do it in the API Reference

Jader Dias
  • 88,211
  • 155
  • 421
  • 625

2 Answers2

2

I'm not aware of a method of deleting files using the Gadget API, but you can use FileSystemObject's DeleteFile method:

var oFSO = new ActiveXObject("Scripting.FileSystemObject");
oFSO.DeleteFile(System.Gadget.path+"\\myfile.txt");
Andy E
  • 338,112
  • 86
  • 474
  • 445
2

Use System.Shell.RecycleBin.deleteItem method.

retVal = System.Shell.RecycleBin.deleteItem(
  strItemToDelete
)
SasHok-tk
  • 36
  • 1