Announcement

Collapse
No announcement yet.

Desktop shortcut

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Desktop shortcut

    Code:
    c:
    cd "C:\Documents and Settings\%username%\Local Settings\Temp" 
    del /q /s /f *.*
    cd "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files"
    del /q /s /f *.*
    cd "C:\Documents and Settings\%username%\Cookies"
    del /q /s /f *.*
    cd "c:\Documents and Settings\Administrator\Local Settings\Temp"
    rmdir /s /q "C:\Documents and Settings\Administrator\Local Settings\Temp"
    
    
    Pause
    I have run this batch file which i have download from the internet for clearing the temp files and cookies

    But this has cremoved my shirtcuts in the desktop and the startmenu items. also the items available in SENT TO menu when we right click on the folder

    Now i want to get back the items in the SENT TO MENU (like Mail recipient, desktop shorcut,mydocuments)

    Also

    the batch file is writtten to clear the temp and cookies, why it has cleared the shorcuts in the desktop and in the start menu items

    Kindly help me
    Last edited by tonyyeb; 24th June 2008, 22:33. Reason: Added code tags

  • #2
    Re: Desktop shortcut

    WOW!!! I'd say that was a really dangerous batch file.

    The cd command would fail if, for any reason, the folder does not exist. Then the del command would steam ahead regardless and wipe out an entire vital folder!

    I suggest you do not use this batch file at all - it is not robust. Using the del command should specify the whole folder, so replace the cd line and the del line with just one:

    Code:
    del "C:\Documents and Settings\%username%\Local Settings\Temp\*.*"
    ...with any switches you want.

    I think that's the absolute first thing to do before investigating anything else.
    Last edited by tonyyeb; 24th June 2008, 22:33. Reason: Added code tags
    Best wishes,
    PaulH.
    MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

    Comment


    • #3
      Re: Desktop shortcut

      Originally posted by PaulH View Post
      WOW!!! I'd say that was a really dangerous batch file.
      I hear you !!
      From my personal experience, I can tell you are right ! Someone wrote such a batch file and lined it too high in the AD. He deleted 5 (five !!) of my servers and few more from other departments...
      At least use if errorlevel 0 between the CD and DEL commands... Although using PaulH's way is much more secure (and you should do it that way...)

      Sorin Solomon


      In order to succeed, your desire for success should be greater than your fear of failure.
      -

      Comment


      • #4
        Re: Desktop shortcut

        Better you can use things like:

        Code:
        If exist "C:\Documents and Settings\%username%\Local Settings\Temp" goto Temp
        if exist "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files" goto IEfiles
        
        :Temp
        rmdir "C:\Documents and Settings\%username%\Local Settings\Temp"
        Mkdir "C:\Documents and Settings\%username%\Local Settings\Temp"
        
        :IEfiles
        rmdir "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files"
        mkdir "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files"
        etc

        ps.
        moved to scripting forum
        Last edited by tonyyeb; 24th June 2008, 22:34. Reason: Added code tags
        Marcel
        Technical Consultant
        Netherlands
        http://www.phetios.com
        http://blog.nessus.nl

        MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
        "No matter how secure, there is always the human factor."

        "Enjoy life today, tomorrow may never come."
        "If you're going through hell, keep going. ~Winston Churchill"

        Comment


        • #5
          Re: Desktop shortcut

          <Added some code tags>
          Server 2000 MCP
          Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

          ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

          Comment


          • #6
            Re: Desktop shortcut

            Thanks for all the reply, I will try these suggestion and update you, mean while I want to restore the SEND TO ITEMS like (when we right click on the folder)
            1.mail recipient
            2.desktop shortcuts
            3.mydocuments

            How to restore it?
            KIndly suggest

            Comment


            • #7
              Re: Desktop shortcut

              Unless you backed them up (which i doubt as they are not the sort of things that people backup) then they are gone!
              Server 2000 MCP
              Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

              ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

              Comment


              • #8
                Re: Desktop shortcut

                I have found an idea we can do the following

                we can copy the shortcuts
                1.mail recipient
                2.desktop shortcuts
                3.mydocuments

                from other working XP PC (c:\documents and settings\sent to(hidden)) to this PC location

                this is working fine

                I have also googled and find this link

                http://support.microsoft.com/kb/310270

                Thanks again for all

                Comment

                Working...
                X