Author Topic: Deleting Specific files.  (Read 1307 times)

0 Members and 1 Guest are viewing this topic.

llennellv3

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 0
    • View Profile
Deleting Specific files.
« on: September 08, 2013, 03:10:47 PM »
EDIT: I feel stupid. I think I found the answer. File:Delete. I originally thought that would delete any highlighted file...but it seems to have a place to enter a specific file. Sorry to have wasted a post.


Edit 2: It works fine. However I tried to apply it to a web page shortcut that gets created on my downloads often. Since the shortcut file has no file extension, I wrote it just like the shortcut.

Let's say the website shortcut was named "Vox Commando" I tried K:\Downloads\Vox Commando, but that doesn't work. I'll keep playing with it. Maybe Vox_Commando?! Maybe .URL? Will update.




Hi there. I have been away for a WHILE. Actually I had to run Windows 8 on safe mode since it's release, until now. I didn't use many programs while in safe mode, so I had little for Vox. Since my PC is back working as it should, I re-installed. and re-configured VC again. Better yet, I went to Youtube and seen all the "new" videos that have REALLY helped me. It's basic stuff, and stuff that was explained to me, but never grasp until now with videos. I am a "visual" learner.

 I have a question tho. How would I create a command that will delete a specific file when executed. I have a program on my computer, that every now and then acts stubborn, and opens in the background, without any way to bring the window up, other than ending the process, deleting the "settings" file, and reopening the program again.

 I want to say anything along the lines of "Erase X's settings" and have that file deleted. Is this possible?

Thanks.
« Last Edit: September 08, 2013, 03:44:28 PM by llennellv3 »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Deleting Specific files.
« Reply #1 on: September 08, 2013, 03:40:15 PM »
Hi llennellv3, quick answer - here it is: http://voxcommando.com/mediawiki/index.php?title=Actions#Delete  ;)
***********  get excited and make things  **********

llennellv3

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Deleting Specific files.
« Reply #2 on: September 08, 2013, 03:48:37 PM »
Yes, thank you. I noticed that AFTER I posted this :-( What's so sad about it, a Google search took me right to it. I blame it on the lack of sleep.

 I had trouble deleting a web shortcut on my PC too...but adding .URL at the end did the trick. Thank you.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Deleting Specific files.
« Reply #3 on: September 08, 2013, 03:58:51 PM »
It sounds like you have a virus.  This is not the solution.

I think you should get some anti-virus software and some anti-spyware software and clean up your system!

File.Delete expects the path to a file as the parameter.  K:\Downloads\Vox Commando would be a path to a folder maybe, but not a file.  A filename will include an extension, such as .txt or .exe

If you click on the 3 blocks icon of an action in the LCB it will open the parameter helper.  There is a button that helps you select a file and automatically create a path. [attachment=1]

Also of note:  Sometimes you won't be able to delete a file if it is open and you may need to kill the process that has it open (virus process for example).  Here is a command that shows how to kill the chrome process.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="1098" name="taskkill chrome" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch.RawParam</cmdType>
    <cmdString>C:\Windows\System32\taskkill.exe&amp;&amp;/F /IM chrome.exe</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>