Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Deleting file on the client  (Read 9243 times)
Snorri B.
Posts: 103


« on: March 11, 2014, 04:50:12 pm »

Hi.

I am trying to delete a file on the client workstation using frontcall. It always fails.

the value of delstr is
del C:\Users\Snorri\AppData\Local\Temp\prentarar.pdf

The call is:
call ui.interface.frontCall("standard","execute",[delstr,1],[ret])

If I execute the displayed del command in Command Prompt on the client workstation it works fine. Any thoughts?

Best regards,
-Snorri
Lionel F.
Four Js
Posts: 82


« Reply #1 on: March 11, 2014, 05:53:16 pm »

Hi Snorri,

"execute" works with executable programs, not with command lines. So you have to execute "cmd.exe" and then pass the command line.

The value of your delstr variable should be something like :
cmd /C del C:\\Users\\Snorri\\AppData\\Local\\Temp\\prentarar.pdf

You can use cmd.exe /? in order to see the list of cmd various available options.

Best regards,
Lionel
Snorri B.
Posts: 103


« Reply #2 on: March 12, 2014, 11:33:09 am »

Hi Lionel and thanks.

This works fine.
Maybe I could suggest that the manuals should be more verbose on this issue :)

Best regards,
-Snorri
Lionel F.
Four Js
Posts: 82


« Reply #3 on: March 12, 2014, 11:53:58 am »

Hi Snorri,

The documentation says : "Executes a command on the workstation with or without waiting" ....indeed I agree it could be more verbose :)

A good pattern is to use commands that can be executed from the Windows startmenu (in the "execute" (Windows XP) or "search" field (Windows 7)). For instance if you type "del c:\tmp\myfile.txt", it will not work. But if you type "cmd /C del c:\tmp\myfile.txt" then it will.

Regards,
Lionel
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines