Jump to content

Problem deleting shorcuts in .CMD and BATCH files


Recommended Posts

Hello people, i have two problems :/

I like delete this shorcuts when my system started for first time:

in my delete.cmd have this

ECHO.
ECHO Eliminando accesos directos...
DEL "%systemdrive%\Documents and Settings\All Users\Menu Inicio\Asistencia remota.lnk"
DEL "%systemdrive%\Documents and Settings\Administrador\Menu Inicio\Asistencia remota.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Inicio\POWERPOINT presentacion.lnk"
DEL "%systemdrive%\Documents and Settings\Administrador\Menu Inicio\POWERPOINT presentacion.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Inicio\ACCESS base de datos.lnk"
DEL "%systemdrive%\Documents and Settings\Administrador\Menu Inicio\ACCESS base de datos.lnk"

but don't work.. not remove anything :angry:

try with .BAT file but don't work

i have Windows XP SP2 in spanish

Help!

Link to comment
Share on other sites


make sure you have the path rignt. type

dir "%systemdrive%\Documents and Settings\All Users\Menu Inicio\Asistencia remota.lnk"

if you get "The system cannot find the file specified." then the path is wrong.

use the /F /Q option with delete to delete read only files.

del /F /Q "C:\Documents and Settings\All Users\Start Menu\Programs\TextPad.lnk"

ALLUSERSPROFILE=C:\Documents and Settings\All Users so you could write

del /F /Q "%ALLUSERSPROFILE%\Start Menu\Programs\TextPad.lnk"

I like to check that a link exists before deleting it.

if exist "%ALLUSERSPROFILE%\Start Menu\Programs\TextPad.lnk" del /F /Q "%ALLUSERSPROFILE%\Start Menu\Programs\TextPad.lnk"

Link to comment
Share on other sites

you might want to delete these from the default profile during the RunOnceEx stage of setup to. Otherwise any new profile that is created will inherit its start menu items from there.

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...