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.

Short batch file question!

Featured Replies

Hi

Sorry for this but i was just woundering how a command line in a batch file would look like if i want it to automaticly answer Yes or No.

I have a batch file i made (cleanup.cmd)

but some of the commands prompt me like this: (är du säker J/N?)

whitch is Swedish for (Are you sure Y/N?)

so a line like this prompt me to answer Yes or No:

DEL "%systemroot%\Web\Wallpaper\*.*"

How would the line look if i want it to automaticly say Yes?

Ill try to search in cmd help some more in the meenwhile

EDIT:

is this right?

DEL "%systemroot%\Web\Wallpaper\*.* /Q"

Thanx

Edited by Fascix


This is right :

DEL /Q %systemroot%\Web\Wallpaper\*.*

-> the "/Q" switch must be right after the "DEL" command (as you can see with DEL /?)

-> The quotes are needed ONLY when using file names/pathes with spaces (1st line below), and you can use them only on the "path part with spaces" (2nd line below) :

DEL /Q "%systemdrive%\Program Files\blablabla\*.*"
DEL /Q %systemdrive%\"Program Files"\blablabla\*.*

bye

It should work, but in general you should use the del /F /Q command to make sure that writeprotected also are deleted without request.

  • Author

Delprat: Yes ofcourse, thats right. Thanx

Doc Symbiosis: Good point ill make sure ill apply that to the cleanupt that needs it. Thanx

If you come into a case where you do not have a handy switch, this method will work for you:

echo y | DEL "%systemroot%\Web\Wallpaper\*.*"

You could also use a vbs file to delete the stuff.

Things In Green Are The Part Of The Script That Perform The Action

Things In Orange Are Safe To Remove From Examples

Things In Blue Are The Objects Needed For Various Task, These Are Like

Cmd Promt Ping Dir Tree, But Are More Powerful Than Cmd Promts.

Example One

This Runs A Check Then Will Delete

Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

Dim Act :Set Act =  CreateObject("Wscript.shell")

Dim Sd : Sd = Act.ExpandEnvironmentStrings("%systemdrive%")

Dim Wd : Wd = Act.ExpandEnvironmentStrings("%Windir%")

Dim RmWd

RmWD = (Wd & "\Web\Wallpaper")

  If Fso.FolderExists(RmWD) Then

Fso.DeleteFile(Wd & "\Web\Wallpaper\*.*")

MsgBox RmWD

Else

End If

Example 2

On Error Resume Next = If This Is Not There Then You Will Not

Get A Error Message

  Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

  Dim Act : Set Act = CreateObject("Wscript.shell")

  Dim Wd : Wd = Act.ExpandEnvironmentStrings("%Windir%")

  On Error Resume Next

    Fso.deleteFile(WD & "\Web\Wallpaper\*.*)

Example 3

This Will Work Only From The Drive That The Script Start From

EG If This Script Was Started From E and Windows Is On C Then It

Would Produce A Error.

If The Script Is Ran From The Same Drive That Windows Is Installed

On Then It Will Work.

  Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

   Fso.DeleteFile( "\Windows\Web\Wallpaper\*.*")

Example 4

Same As Example 3 But Has A Error Control

On Error Resume Next

CreateObject("Scripting.FileSystemObject") .DeleteFile( "\Windows\Web\Wallpaper\*.*")

Edited by gunsmokingman

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.