Windows 10: Batch script question

Discus and support Batch script question in Windows 10 Support to solve the problem; Hello, I want make a batch script to delete a spefic folder on the C disk, but how can I get only that spefic folder? I got this: Code: FOR /D %%p... Discussion in 'Windows 10 Support' started by Dropbox, Aug 18, 2016.

  1. Dropbox Win User

    Batch script question


    Hello,

    I want make a batch script to delete a spefic folder on the C disk, but how can I get only that spefic folder? I got this:
    Code: FOR /D %%p IN ("C:\USERS\%USERNAME%\Downloads\*.*") DO rmdir "%%p" /s /q cd C:\USERS\%USERNAME%\Downloads\ del *.* /q /s timeout /t 5 >nul 2>&1 /nobreak cls[/quote] It works currently for the Downloads folder, but how can I change that? *Smile

    :)
     
    Dropbox, Aug 18, 2016
    #1
  2. amikhan1 Win User

    How to add a prompt dialog box through a batch file

    Hi All,

    Hope you all are doing good, I have a simple question where in i am trying to run two batch scripts and i want to add a prompt dialog box after the completion of one script so that once the user hits Yes the second batch file should not run if clicked on
    no it should execute the batch file

    Your suggestion would be of great help.

    Thanks
     
    amikhan1, Aug 18, 2016
    #2
  3. dsykes14 Win User
    Windows 10 Starts CMD.exe minimized

    So we have a logon script that is a kixtart script executed by a batch file. This script operates normally under Windows 7, but will not show when using Windows 10. Upon further investigation, whenever starting a batch script, the script will always start
    minimized. What could be causing this behavior? There are no GPOs set to make these scripts minimized.

    Thank you
     
    dsykes14, Aug 18, 2016
    #3
  4. Batch script question

    That script looks so complicated, I prefer simple ones like:

    Code: rmdir "%USERPROFILE%\Downloads" /s /q mkdir %USERPROFILE%\Downloads[/quote]
     
    TairikuOkami, Aug 20, 2016
    #4
  5. Dropbox Win User
    And how would that work for the C:\ folder? *Redface
     
    Dropbox, Aug 20, 2016
    #5
  6. %USERPROFILE% will choose the current user profile wherever it is located.

    If you want to specify a system disk, you can use %SystemDrive%

    A random folder would be:

    rd ""C:\AMD"" /s /q

    rd ""%SystemDrive%\AMD"" /s /q
     
    TairikuOkami, Aug 20, 2016
    #6
  7. Dropbox Win User
    Code: FOR /D %%p IN (%SystemDrive%\Windows.old) DO rmdir "%%p" /s /q cd %SystemDrive%\Windows.old del *.* /q /s timeout /t 5 >nul 2>&1 /nobreak cls[/quote] That?
     
    Dropbox, Apr 4, 2018
    #7
Thema:

Batch script question

Loading...
  1. Batch script question - Similar Threads - Batch script question

  2. Batch scripting

    in Windows 10 Software and Apps
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  3. Batch scripting

    in Windows 10 Gaming
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  4. Batch scripting

    in Windows 10 Network and Sharing
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press any key. echo Before...
  5. PageFile.sys batch script

    in Windows 10 Virtualization
    PageFile.sys batch script: Hello, I need help writing a batch script that would configure Windows Virtual Memory based on the amount of RAM installed If you have 4 GB of RAM, set virtual memory to 8 GB (Custom size: set both initial and maximum size to 8192) If you have 8 GB of RAM, set virtual memory...
  6. How to undo a batch script

    in Windows 10 Network and Sharing
    How to undo a batch script: I decided it would be a good idea to download and run a random batch script from the internet to get the ability to move files around freely, rather than sticking to the presets. Microsoft, if you see this, please allow us to move and organize files as we wish and not have to...
  7. Batch Rename Script Help!

    in Windows 10 Support
    Batch Rename Script Help!: Hello! I am very new to this and need a little help. I am trying to create a batch file that will rename files that are called png_X.png (the X being the number page it is). The code I have is below. It works fine with out the pipe sort command but it sorts the by the ones...
  8. Batch Scripts / Programs.

    in Windows 10 Performance & Maintenance
    Batch Scripts / Programs.: The members and quests who use this forum know how professional, informative and helpful it is! In order to help members solve their problems/issues we often ask them to run certain programs and perform certain tasks and then upload [ post ] the results to the forum for us...
  9. Batch scripting problems

    in Windows 10 Ask Insider
    Batch scripting problems: So i found a bug. In batch scripting, I can only store 3 variables. I don't know the cause for this. Here's the code, if you need it. @ echo off title Elevator OS by Lackmey on YouTube and Reddit set gdata=No data found (this one works) set 1data=No data found (this one...
  10. [Question] Delete files with denied access with batch scripts

    in Windows 10 Support
    [Question] Delete files with denied access with batch scripts: Ciao, dopo anni ho iniziato a lavorare con script batch di nuovo, ma non riesco a eliminare un file nella directory principale "C", (usando W10 ultima release), questo è lo script che mi d "accesso negato". [code] @echo off cls del "C: \ SYSTAG.BIN" / A / F / Q / S...