Marthax Posted May 15, 2005 Share Posted May 15, 2005 Hi Everyone!I've been sitting with my Cleanup file for a while now and I can't seem to figure out what's wrong with it. It keeps complaining that it cannot find the specified file. I've tried various syntaxes and none of them works. This is driving me nuts. Could someone please help me out here?This is a Syntax that gets the "Cannot find the specified file" answer returned:del %UserProfile%\Desktop\VLC media player.lnkCheers,Marthax Link to comment Share on other sites More sharing options...
Priapulidae Posted May 15, 2005 Share Posted May 15, 2005 Since your filename has spaces in it maybe you should use quotations around the path?"%UserProfile...blabla" Link to comment Share on other sites More sharing options...
Mike_Wilson Posted May 15, 2005 Share Posted May 15, 2005 try del "%UserProfile%\Desktop\VLC media player.lnk"It says it cannot find the file because it halts after VLC and there is no file in the desktop folder called VLC. Link to comment Share on other sites More sharing options...
Yzöwl Posted May 15, 2005 Share Posted May 15, 2005 You may also be better off checking if it exists first too, not that the code given will not work just better practice. Also you could add the /Q (quiet) switch.if exist "%UserProfile%\Desktop\VLC media player.lnk" del /q "%UserProfile%\Desktop\VLC media player.lnk" Link to comment Share on other sites More sharing options...
DLF Posted May 15, 2005 Share Posted May 15, 2005 If you're trying to delete ALL desktop shortcuts see this excellent post here:http://www.msfn.org/board/index.php?showtopic=45909&st=10#Credit all goes to Yzowl. Link to comment Share on other sites More sharing options...
gunsmokingman Posted May 15, 2005 Share Posted May 15, 2005 You can use vbs to remove the shortcuts.This will remove all shortcuts on the desktop.If you want to remove a specific short cutthen change this ( AP & "\Desktop\ *.lnk")to this ( AP & "\Desktop\ NAME-OF-THE-SHORTCUT.lnk")Then save this as RemoveSC.vbsON ERROR RESUME NEXTDim Shell : Set Shell = WScript.CreateObject("WScript.Shell")Dim AP : AP = Shell.ExpandEnvironmentStrings("%AllUsersProfile%")Set fso = CreateObject("Scripting.FileSystemObject")fso.DeleteFile( AP & "\Desktop\ *.lnk") Link to comment Share on other sites More sharing options...
Marthax Posted May 15, 2005 Author Share Posted May 15, 2005 that was it . Thank you all for the replies.Cheers,Marthax Link to comment Share on other sites More sharing options...
Larry Posted May 16, 2005 Share Posted May 16, 2005 Try %AllUsersProfile% and yes put quotes around the whole thing.Depending on the program sometime the shorcuts get installed under the userprofile and sometime under the allusersprofile. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now