Need help wih a .bat file commands

Page 2 of 2 FirstFirst 12

  1. Posts : 71
    Windows 7 Home Premium 32bit
    Thread Starter
       #11

    Ok OK, i almost managed to work ;o

    here is how it looks like now:

    Code:
    @echo off
    xcopy /Y %userprofile%\Desktop\*.* %userprofile%\DesktopFiles\  /s /q /f
    
    c:
    cd\ 
    cd "%userprofile%\Desktop"
    dir *.* /b -o:d | find /v "." > \dirs.txt
    for /f "tokens=*" %%a in (\dirs.txt) do call :DelFiles "%%a"
    del \dirs.txt
    exit /b
    
    :DelFiles %1
    set Flag=0
    if %1=="All Users" set Flag=1
    if %1=="Administrator" set Flag=1
    if %1=="CurentUser" set Flag=1
    if "%Flag%"=="0" (
    cd %1
    attrib *.* -r /s
    cd..
    rem change rd %1 /s /q
    rem for no confirmation
    rd %1 /s
    )
    del %userprofile%\Desktop\*.* /s /q /f
    the only issue is that every time when finds folder, now it keeps ask me or i do wanna delete this folder Y/N?

    please tell me what to correct in this code to stop it ask me for Y/N and just pick Y automatically :)
      My Computer


  2. Posts : 71
    Windows 7 Home Premium 32bit
    Thread Starter
       #12

    newermind, i figured out myself.. it works now like a charm. if anyone needs this desktop .bat for some reason, pm me :)
      My Computer


 
Page 2 of 2 FirstFirst 12

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

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