batch file fails after upgrade to v2004

Page 1 of 3 123 LastLast

  1. Posts : 416
    Win10 32bit v20H2
       #1

    batch file fails after upgrade to v2004


    The code <<"" nircmd.exe emptybin>> used to clear the content out of the Recycle Bin at startup, but now does not.
    How might I restore its functionality ?
      My Computer


  2. Posts : 31,622
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #2

    Sebastian42 said:
    The code <<"" nircmd.exe emptybin>> used to clear the content out of the Recycle Bin at startup, but now does not.

    Nircmd is another one of NirSoft's useful little utilities, it's not one I used before though. The command nircmd emptybin certainly works from a command prompt in my 2004.

    How might I restore its functionality ?

    To answer that we need to know how it functioned before. How exactly are you running it at startup? A scheduled task? A .bat file in your ...\Start Menu\Programs\Startup folder? Something else?

    Also, have you got the latest version? The current one is version 2.86.
      My Computers


  3. Posts : 416
    Win10 32bit v20H2
    Thread Starter
       #3

    Bree - I wanted to go for the Task Scheduler, but the instructions do not match the 'responses', so till I get more accurate instructions, I'll pursue YOUR avenue... I ran a batch file in the StartUp folder. The NIRCMD I use is v2.4.6 - I will update it and see if that solves the problem.
      My Computer


  4. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

    I have deleted my unacknowledged response. Good luck.
      My Computers


  5. Posts : 416
    Win10 32bit v20H2
    Thread Starter
       #5

    Dalchina - if you were the one who suggested a Scheduled task - I like the idea and have just tried to implement it, but the instructions in the first URL did not match; and I have not yet had time to try the second - which now appears to be gone.
      My Computer


  6. Posts : 7,606
    Windows 10 Home 20H2
       #6

    Use Task Scheduler to run a CMD file containing the following command:

    PowerShell Clear-RecycleBin -force -ErrorAction:Ignore

    Source: Empty Recycle Bin in Windows 10

    Alternatively, put the CMD file into the following folder:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
      My Computer


  7. Posts : 416
    Win10 32bit v20H2
    Thread Starter
       #7

    Matthew - Power Shell puts me off a little, so before I struggle with that, I want to report that I tried to update my NIRCMD. Instead of getting a download option, I saw a vast list of ways to USE it; and the suggestion for emptying the recycle bin, lacked the two double apostrophes in my code. So I deleted them from my batch file and ran it. The 'DOS' window stayed open and the bin did not empty - but when I forced the 'DOS' window to close, the bin did empty.
    So with tweaking (I still have to discover what), that batch file will still work.

    I prefer the Task Scheduler method - but it is NOT dead-easy for me to do.
    Having the CMD window NOT show is even more attractive, but VBS daunts me even more than what you had already proposed.
    Locating the CMD file where you suggest is a piece of cake for me; but MAKING a CMD file is not. I am used to batch files, and if it is just a matter of inserting your code into a text file and renaming the extension to CMD - again that is well within my skills.
      My Computer


  8. Posts : 31,622
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #8

    There are multiple recycle bins, one for each user. And each user can only see or empty their own.

    batch file fails after upgrade to v2004-image.png

    Scheduling at start up is therefore problematic, you'd need to somehow specify the user who's bin it should empty. Scheduling at sign in may work.

    Running from a .bat in the Start up folder is straight forward though, as it runs after the user has signed in. If you put the batch file in the All Users Start up folder C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp it will run for whoever signs in.

    I've just tested that in 2004. It runs shortly after you sign in and you'll see a command prompt window open briefly while it runs.
      My Computers


  9. Posts : 416
    Win10 32bit v20H2
    Thread Starter
       #9

    Bree - USERS is a non-issue. Remember, that batch worked well until now. I have seen and been perplexed by multiple recycle bins, but they have never been a problem to me.

    - - - Updated - - -

    I notice the mention of VBS by one of the kind replyers has also disappeared from the thread.

    Putting the code above into a text file and naming the extension CMD does indeed create the equivalent of a batch file, so may well make any further labours redundant.
      My Computer


  10. Posts : 31,622
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #10

    Sebastian42 said:
    Having the CMD window NOT show is even more attractive....
    For that you need put the batch file somewhere else anyone can access it (eg C:\Users\Public) and place a shortcut to the batch file in the Start up folder. You can specify that a shortcut runs minimised. You'll still see it appear briefly on the taskbar, but that's all.

    batch file fails after upgrade to v2004-image.png
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:15.
Find Us




Windows 10 Forums