Jump to content
Sign in to follow this  
d3mon

problem for delete shortcut

Recommended Posts

d3mon

Hello,

This is part of my script :

FileCreateShortcut(@ProgramFilesDir&"\PMD\PMD.exe",@StartupCommonDir&"\PMD",@ProgramFilesDir&"\PMD")
FileDelete(@StartupCommonDir&"\PMD")

The script create shortcut but doesn't delete it, why ?

Edited by d3mon

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites
Paulie

i'd say its not deleting because you have

"oÝ÷ Øý½ëkçm+-¢®¶­sdfÆT7&VFU6÷'F7WB&öw&ÔfÆW4F"fײgV÷C²b3#µÔBb3#µÔBæWRgV÷C²Ä7F'GW6öÖÖöäF"fײgV÷C²b3#µÔBææ²gV÷C²Ä&öw&ÔfÆW4F"fײgV÷C²b3#µÔBgV÷C²¤fÆTFVÆWFR7F'GW6öÖÖöäF"fײgV÷C²b3#µÔBææ²gV÷C²"

in your script.

(How about you edit the post and use {code} tages

Share this post


Link to post
Share on other sites
d3mon

FileCreateShortcut(@ProgramFilesDir&"\PMD\PMD.exe",@StartupCommonDir&"\PMD",@ProgramFilesDir&"\PMD")
FileDelete(@StartupCommonDir&"\PMD")

That's better ^^ Anyhelp ?


No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites
Paulie

try this:

FileCreateShortcut(@ProgramFilesDir&"\PMD\PMD.exe",@StartupCommonDir&"\PMD.lnk",@ProgramFilesDir&"\PMD")
FileDelete(@StartupCommonDir&"\PMD.lnk")

Dunno? :P

Share this post


Link to post
Share on other sites
d3mon

try this:

FileCreateShortcut(@ProgramFilesDir&"\PMD\PMD.exe",@StartupCommonDir&"\PMD.lnk",@ProgramFilesDir&"\PMD")
FileDelete(@StartupCommonDir&"\PMD.lnk")

Dunno? :P

Don't work too...perhaps autoit version problem ?

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites
martin

try this:

FileCreateShortcut(@ProgramFilesDir&"\PMD\PMD.exe",@StartupCommonDir&"\PMD.lnk",@ProgramFilesDir&"\PMD")
FileDelete(@StartupCommonDir&"\PMD.lnk")

Dunno? :P

Maybe you should try

FileDelete(@StartupCommonDir&"\PMD.pif")

and definitely you should try to stop using AutoIt tags. Use code tags they are reliable, AutoIt tags are not.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
d3mon

Maybe you should try

FileDelete(@StartupCommonDir&"\PMD.pif")

and definitely you should try to stop using AutoIt tags. Use code tags they are reliable, AutoIt tags are not.

Don't work too wtf ?

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites
martin

Don't work too wtf ?

OK.

What I did was I used the command prompt and did DIR. It showed that the file name was as expected but that the extension was pif not lnk. Now I realize that the pif was because I chose a shortcut to a 16 bit DOS program. Apologies.

Anyway here is what I did to test and if I keep the lnk extension and make a shortcut to notepad then the filedelete works.

ConsoleWrite(FileCreateShortcut(@WindowsDir & "\notepad.exe",@ScriptDir & "\Shortcut To np.lnk",@ScriptDir) & @CR)
$s =  @ScriptDir & "\Shortcut To np.lnk"
ConsoleWrite("$s = " & $s & @CRLF)
ConsoleWrite(@CRLF & FileDelete($s) & @CR)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
d3mon

OK.

What I did was I used the command prompt and did DIR. It showed that the file name was as expected but that the extension was pif not lnk. Now I realize that the pif was because I chose a shortcut to a 16 bit DOS program. Apologies.

Anyway here is what I did to test and if I keep the lnk extension and make a shortcut to notepad then the filedelete works.

ConsoleWrite(FileCreateShortcut(@WindowsDir & "\notepad.exe",@ScriptDir & "\Shortcut To np.lnk",@ScriptDir) & @CR)
$s =  @ScriptDir & "\Shortcut To np.lnk"
ConsoleWrite("$s = " & $s & @CRLF)
ConsoleWrite(@CRLF & FileDelete($s) & @CR)
Yep succesfully works ! Why ? because i was using .Ink extension instead of shortcut extension .lnk ...Anyway thanks :P

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites
sleepydvdr

FileDelete(@StartupCommonDir&"\PMD.pif")

I was having the same problem I was using:

filedelete (@DesktopCommonDir & "\example.lnk")

It worked on some computer and some operating systems, but not others. Then I found this:

filerecycle (@DesktopCommonDir & "\example.lnk")

File Recycle has worked every single time for me so far. It doesn't delete it, though - it sends it to the recycle bin. I don't know if this is good enough for your needs, but it's good enough for me.

Edited by sleepydvdr

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
youknowwho4eva

what about a filerecycleempty after that?


Giggity

Share this post


Link to post
Share on other sites
leejb

Know this is an old thread, but just thought I'd include that this still seems to be an issue with v3. On Win7 with #RequireAdmin, using FileDelete() on a file located on the desktop x:\users\public\desktop fails, however, doing a FileRecycle() and subsequent FileRecycleEmpty works fine.

If there is a solution to get FileEmpty to work it would be nice as I hate having to empty a recycler and have to add the question to ensure it is OK with the user.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×