Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

deleting shortcuts using CMD

Featured Replies

I'm having a problem with my CMD file. I'm using $OEM$ folder to place a shortcut in my startup folder to run a cmd file that applys my regtweaks and then deletes its own shortcut from startup folder and reboots. unfortunately it doesn't work and after reboot the shortcut is still there starting the whole cycle again.

TITLE Registry Tweaks
COLOR 0F

CLS

ECHO.
ECHO Applying Registry Tweaks...
REGEDIT /S %WINDIR%\INSTALL\Tweak.reg

ECHO.
ECHO All done! Now Windows Vista will reboot one last time...

ECHO.
ECHO -------------------------------------------------------------------------

SLEEP 5

DEL del /f /a /q "%SYSTEMDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\StartVista.lnk"

SHUTDOWN.EXE -R -F -T 5

EXIT

any help would be greatly appreciated.


1st question:

DEL del /f /a /q "%SYSTEMDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\StartVista.lnk"

DEL del ? :unsure:

Semi-random hints:

What happens on a normally booted Vista if you open a command prompt and simply give the command?

DEL del /f /a /q "%SYSTEMDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\StartVista.lnk"

Any error?

Are you sure you have the privileges needed to perform the action?

Can you create a "tag" file somewhere, not on %systemdrive% say in C:\temp and add to the command something like:

(at the beginning)

If exist C:\temp\tagfile.tag goto :EOF

and something at the end like:

If NOT exist C:\temp\tagfile.tag ECHO The REG tweaks have been applied > C:\temp\tagfile.tag

And have another .cmd automatically starting from another link like:

If exist C:\temp\tagfile.tag (
DEL C:\temp\tagfile.tag
DEL /f /a /q "%SYSTEMDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\StartVista.lnk"
)

jaclaz

Edited by jaclaz

  • Author
1st question:
DEL del /f /a /q "%SYSTEMDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\StartVista.lnk"

DEL del ? :unsure:

Semi-random hints:

What happens on a normally booted Vista if you open a command prompt and simply give the command?

DEL del /f /a /q "%SYSTEMDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\StartVista.lnk"

opps thats one problem. even after i remove the double "del" and run the command from a normally booted vista i get "could not find". even if i run prompt as admin. i'm kinda new with scripting as you can tell.

hmmm, what ATTRIButes has that file?

ATTRIB "%SYSTEMDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\StartVista.lnk"

Maybe is hidden / system ...

Besides,

del /f /a /q

the /a parameters, at least in 2K/XP needs the correct attribute following, like in /a:HSR

the /q switch is unneeded

the /f forces the deletion of a read only file, but only if it is not hidden

As a general "rule of thumb" when writing batches, make them in a manner that they can be run from an open command prompt so that you have visual feedback, add to them as much PAUSE statements as you see fit to parse the output, if needed put some @Echo on and @Echo off just before and after relevant lines, to be able to check if the batch works properly, when using parameters in commands, always try with no parameters or just one at the time, double check sintax and make sure to have understood it before using parameters.

A good site with help for the various commands is this one:

http://www.ss64.com/nt/

Always check this site:

http://www.robvanderwoude.com/

to learn more about sintax and to see examples of well written batches.

jaclaz

  • Author

thanks jaclaz, i give those sites a whirl.

Even better add a key in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" instade off a .lnk in Startup folder! :thumbup using: e.g reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v StartVista /t reg_sz /d "%systemdrive%\StartVista.cmd" /f

Edited by Mercury_22

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.