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 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...
  3. Run the audio troubleshooter from a batch script

    in Windows 10 Drivers and Hardware
    Run the audio troubleshooter from a batch script: I have an automated home theatre setup - a batch script that enables my TV as a display, and changes the TV to be my primary display (so games and apps open on my TV instead of my monitor). The same script also changes my default audio device to be the TV. The problem is...
  4. [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...
  5. Netfix Batch Script- Fix internet connection

    in Windows 10 Network and Sharing
    Netfix Batch Script- Fix internet connection: Somebody please try my batch script Netfix and leave feedback so I can improve it. thank you! My goal is to make a troubleshooter to help the built in "Windows Network Diagnostics" fix internet connection problems. How can you help? 1. Download/copy the code on notepad...
  6. Batch script to automatically uninstall and Reinstall a driver

    in Windows 10 Drivers and Hardware
    Batch script to automatically uninstall and Reinstall a driver: For some strange reason I've had a faulty external Seagate 8TB driver/HDD for the last year The problem is this: everytime I reboot the computer, the HDD is not automatically recognized so I have to do this 1. Open Device Manager 2. Remove the USB attached SCSI mass storage...
  7. Automatically Run Batch Script

    in Windows 10 Installation and Upgrade
    Automatically Run Batch Script: Hi everyone When the windows installation is finished, automatically run batch script. How can I do that? Thanks *Wink 122531
  8. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  9. Batch Script to execute in Win 10 pro

    in Windows 10 Support
    Batch Script to execute in Win 10 pro: I'm looking for a batch script that can: Pull the single row taskbar to a 3 row taskbar and lock it in place in its default location (bottom). Change the time format at the bottom right corner from default to have e.g. "2:00 AM" in the first row, "Saturday" in the second...
  10. Help needed writing batch script!

    in Windows 10 Support
    Help needed writing batch script!: Firstly thank you for even clicking on this thread as I understand that this probably isn't meant to be here. The scenario is that I'm trying to write a script that incorporates the result of a ping to an IP and then based on the result do different things. Here is an...