Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: (solved)defragmentation at startup.(Pause for x many seconds?)  (Read 16259 times)

0 Members and 1 Guest are viewing this topic.

GuruGary



    Adviser
    Re: Pause for x many seconds?
    « Reply #15 on: May 13, 2007, 06:09:05 PM »
    If you want the program to run when Windows loads, you will probably want to put a shortcut to the file (or batch file) in the Startup group.  If there is an icon that lets it run automatically, you can just copy that icon to
    C:\Documents and Settings\All Users\Start Menu\Startup
    Or you may need a batch file that starts it for you.  Is there a switch to get it to run without clicking an any buttons?  If so you could copy a batch file (or link to the batch file) to the Startup directory.  The batch file would probably look something like:
    Code: [Select]
    "C:\Program Files\Diskeeper\Diskeeper.exe" /defrag C:Note that I am guessing at the path, filename and switches since it has been a few years since I have used Diskeeper.

    Jonas Wauters

      Topic Starter


      Adviser

    • My Skatevids Check Signature
    • Thanked: 2
      Re: Pause for x many seconds?
      « Reply #16 on: May 14, 2007, 10:04:39 AM »
      First of all thanks for answering.
      Code: [Select]
      echo Wat wil je doen nadat het process voltooid is? [b]What do you want to do after the proces is compeled?[/b]
      echo 1:De computer afsluiten [b]Shutdown computer[/b]
      echo 2:De computer opnieuw opstarten [b]Reboot computer[/b]
      echo 3:Dit venster afsluiten en gewoon verdergaan met werken [b]Just close this window[/b]
      Set /P Quit=Typ (1,2of 3)
      Can't I just add an option like "Reboot you computer and defrag on startup"
      Sow then the computer should reboot and run that program before I get to the welcome screen it should pass the option partition.
      It this possible what I'm asking?
      Please if this thanks to long for you, than do not spend to much time with it.
      I do not want to insist you.
      But I do appreciate it.

      Jonas ;)
      « Last Edit: May 14, 2007, 10:31:20 AM by Jonas Wauters »

      GuruGary



        Adviser
        Re: Pause for x many seconds?
        « Reply #17 on: May 14, 2007, 10:28:58 AM »
        I don't know much about Diskeeper, but I think the task you want is dependent on your software.   It sounds like what you really want is to schedule a defrag before the OS completes booting, similar to the way you can schedule a CHKDSK /F, is that correct?  If so, is it possible to schedule a defrag to launch at the next boot from within the program?  If you can do it within the program then I don't think it would be too hard to do.  If the program can't do it by itself,  then it is probably not practical to attempt to make the program do this.

        Jonas Wauters

          Topic Starter


          Adviser

        • My Skatevids Check Signature
        • Thanked: 2
          Re: Pause for x many seconds?
          « Reply #18 on: May 14, 2007, 10:39:19 AM »
          Yes it is possible white the program but that you have to have the Full version.
          And then you have to pay for it.
          But thats not really what I want to do.

          Isn't it possible to create 2 batch files.
          1 the one I allready have. and just add the option to defrag while booting.
          When I choose that option than it should create:
          You could try adding a line at the end of autoexec.nt in the system32 folder. Include the full path to the batch file.
          Then it should create that to the full path of my second batch file.
          The second batch file should defragment and then remove that line at autoexes.nt.
          Is that possible?

          Jonas ;)

          GuruGary



            Adviser
            Re: Pause for x many seconds?
            « Reply #19 on: May 14, 2007, 10:49:28 AM »
            I don't think adding a line to your AUTOEXEC.NT will work.  I could be wrong, but I think that just loads the environment for when DOS programs are loaded from within Windows.  I don't think that the AUTOEXEC.NT gets executed when the computer boots / login, etc.

            Jonas Wauters

              Topic Starter


              Adviser

            • My Skatevids Check Signature
            • Thanked: 2
              Re: Pause for x many seconds?
              « Reply #20 on: May 14, 2007, 10:59:51 AM »
              Can it do any harm by just trying it?
              Otherwise I'll just add my first batch file to try.
              Than how do I have to do that?
              By the way thanks for replying this fast.

              Jonas ;)

              GuruGary



                Adviser
                Re: Pause for x many seconds?
                « Reply #21 on: May 14, 2007, 03:40:03 PM »
                It won't do any harm by trying it.  You can always remove it from the AUTOEXEC.NT if it causes problems with your PIF files.

                I think the better solution is adding a batch file to your startup group.

                Starting the Diskeeper program isn't going to be that difficult.  But if you want it fully automated, I think there are buttons and icons to click on to get the defrag started, which will be difficult to script.

                Jonas Wauters

                  Topic Starter


                  Adviser

                • My Skatevids Check Signature
                • Thanked: 2
                  Re: Pause for x many seconds?
                  « Reply #22 on: May 15, 2007, 10:36:51 AM »
                  I can't edit autoexe.nt or do I have to do it otherwise than right clicking it and go to edit (because edit is missing.)
                  If I put my Batch file in the startup file than it'll run when I get my desktop and not before the welcome screen sow it will not be able to defrag  the running processes.
                  Starting the Diskeeper program isn't going to be that difficult.  But if you want it fully automated, I think there are buttons and icons to click on to get the defrag started, which will be difficult to script.
                  Yes but then it will again be after the welcome screen.
                  Or am I wrong??

                  Jonas ;)

                  2k_dummy



                    Specialist
                  • A word, once spoken, can never be recalled.
                  • Thanked: 14
                    Re: Pause for x many seconds?
                    « Reply #23 on: May 15, 2007, 11:27:41 AM »
                    You can open and edit autoexec.nt in Notepad.
                    If you don't stand for something, you'll fall for anything.
                    _______________________________________ ________
                    BlackViper

                    Software and utilities

                    GuruGary



                      Adviser
                      Re: Pause for x many seconds?
                      « Reply #24 on: May 15, 2007, 11:29:17 AM »
                      You are right, both ways would be after the welcome screen.

                      The autoexec.nt won't start the defrag before the welcome screen either, though.  But to edit the file, try this:
                      Start -> Run -> notepad %windir%\System32\autoexec.nt

                      Jonas Wauters

                        Topic Starter


                        Adviser

                      • My Skatevids Check Signature
                      • Thanked: 2
                        Re: Pause for x many seconds?
                        « Reply #25 on: May 16, 2007, 03:59:28 AM »
                        If autoexe.nt doesn't extrude before the welcome screen then it also isn't a solution.
                        Maybe safemode but then there are still some running processes.
                        Sow I think it is just impossible.
                        Thanks for helping.

                        Jonas ;)

                        contrex

                        • Guest
                        Re: Pause for x many seconds?
                        « Reply #26 on: May 16, 2007, 04:34:22 AM »
                        start button
                        Run
                        Gpedit.msc
                        Windows Settings
                        Scripts (Startup/Shutdown)
                        Startup
                        Add Script

                        Quote
                        To assign computer startup scripts
                        Open the Group Policy snap-in.
                        In the console tree, click Scripts (Startup/Shutdown).
                        In the details pane, double-click Startup.
                        In the Startup Properties dialog box, click Add.
                        In the Add a Script dialog box, type the following information, and then click OK:
                        Script Name: Type the path to the script, or click Browse to search for the script file in the Netlogon share of the domain controller.

                        Script Parameters: Type any parameters that you want, the same way as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type the following: //logo //I



                        Jonas Wauters

                          Topic Starter


                          Adviser

                        • My Skatevids Check Signature
                        • Thanked: 2
                          Re: Pause for x many seconds?
                          « Reply #27 on: May 19, 2007, 12:54:52 PM »
                          start button
                          Run
                          Gpedit.msc
                          Windows Settings
                          Scripts (Startup/Shutdown)
                          Startup
                          Add Script

                          Quote
                          To assign computer startup scripts
                          Open the Group Policy snap-in.
                          In the console tree, click Scripts (Startup/Shutdown).
                          In the details pane, double-click Startup.
                          In the Startup Properties dialog box, click Add.
                          In the Add a Script dialog box, type the following information, and then click OK:
                          Script Name: Type the path to the script, or click Browse to search for the script file in the Netlogon share of the domain controller.

                          Script Parameters: Type any parameters that you want, the same way as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type the following: //logo //I



                          I've tried this but it doesn't seem to work.
                          Code: [Select]
                          Title Defragmenteren
                          @echo off
                          cls
                          echo Dit programma is gemaakt door Jonas Wauters.
                          echo Dit programma defragmenteerd C: en D: schijf.
                          echo Defragmentatie zorgt voor een optimaal gebruik van uw harde schijven.
                          Ping 1.1.1.1 -n 5 -w 1000 > nul
                          cls
                          echo Wat wil je doen nadat het process voltooid is?
                          echo 1:De computer afsluiten
                          echo 2:De computer opnieuw opstarten
                          echo 3:Dit venster afsluiten en gewoon verdergaan met werken
                          Set /P Quit=Typ (1,2of 3):
                          Vol C:
                          defrag -f C:
                          If not exist d: GOTO e
                          vol d:
                          defrag -f d:
                          :e
                          if not exist e: GOTO f
                          vol e:
                          defrag -f e:
                          :f
                          if not exist F: GOTO g
                          vol f:
                          defrag -f f:
                          :g
                          If %Quit%=1 then GOTO Q1
                          If %Quit%=1 then GOTO Q2
                          This is the code of the program I want to run after startup I dind't fil in any Parameters.
                          Or is this my mistake?

                          Thanks for this post I hope that I just made a mistake.

                          Jonas ;)
                          « Last Edit: May 19, 2007, 03:00:01 PM by Jonas Wauters »

                          Jonas Wauters

                            Topic Starter


                            Adviser

                          • My Skatevids Check Signature
                          • Thanked: 2
                            Re: Pause for x many seconds?
                            « Reply #28 on: May 19, 2007, 01:42:33 PM »
                            I think I should make a new topic on this-one.
                            Should I?

                            contrex

                            • Guest
                            Re: Pause for x many seconds?
                            « Reply #29 on: May 19, 2007, 01:45:19 PM »
                            I think the scripts that execute before login are special in some way.

                            In your script,

                            you should not have "then"

                            If %Quit%=1 then GOTO Q1
                            If %Quit%=1 then GOTO Q2

                            What does the second of those lines do?

                            And where are labels Q1 and Q2?