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

Author Topic: command line syntax  (Read 10654 times)

0 Members and 1 Guest are viewing this topic.

Dizzzy

    Topic Starter


    Greenhorn

    command line syntax
    « on: June 15, 2008, 06:35:15 PM »


    If exist 1.txt and 1.doc del 1.txt

    Would this be the right command line syntax to find out if both a .txt and a .doc version of the same file name exists in a directory and then delete the file with the .txt extention if both exist?

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: command line syntax
    « Reply #1 on: June 15, 2008, 07:09:26 PM »
    You could try this:

    Code: [Select]
    if exist file.txt (
    if exist file.doc del file.doc
    )

    Dizzzy

      Topic Starter


      Greenhorn

      Re: command line syntax
      « Reply #2 on: June 16, 2008, 12:05:19 AM »
      Yes, thanks. I tried that for one filename and it works but what I really meant to ask was how to do all of the files in a directory? Would I proceed the if exist statement with DIR > and if so what kind of parameter would I use in the if exist statement to receive the directory statement output?

      Dias de verano

      • Guest
      Re: command line syntax
      « Reply #3 on: June 16, 2008, 12:17:03 AM »
      I really meant to ask was how to do all of the files in a directory?

      DEL *.* does that.


      Dizzzy

        Topic Starter


        Greenhorn

        Re: command line syntax
        « Reply #4 on: June 24, 2008, 11:45:33 PM »
        I really meant to ask was how to do all of the files in a directory?

        DEL *.* does that.



        You have taken my statement out of context and then provided an mindless and irrelevant response.

        DEL *.* does not do what I asked.

        DEL *.* does not test all filenames to see if a particular file extension exists and then delete a different file extension for the same filename.

        Dias de verano

        • Guest
        Re: command line syntax
        « Reply #5 on: June 25, 2008, 12:18:02 AM »
        You have taken my statement out of context and then provided an mindless and irrelevant response.

        I understand now. Sorry. I do know an answer to your query, but since you were so rude, I shall not bother posting it. Good luck.

        Dizzzy

          Topic Starter


          Greenhorn

          Re: command line syntax
          « Reply #6 on: June 26, 2008, 06:53:03 PM »
          One reason people ask and answer questions on a public forum is so that other members can benefit from the question and answers as well.

          Your answer was serious enough to put everyone at risk. If it was only a thoughtless answer without intent of causing harm you would have corrected it.


          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: command line syntax
          « Reply #7 on: June 26, 2008, 09:42:19 PM »
          I couldn't think of a way to do this with a batch file, but I made a VBScript that should do the job sufficiently.

          I apologize for it's length. It probably could have been shorter, but it worked for all my test cases I could contrive.
          I recommend you back up the files before running this script on them. I don't want to be responsible for loss of important data.


          Just Copy & Paste it into a script file- I recommend extvdel.vbs, but anything goes, as long as you remember the filename.

          Code: [Select]



          'extvdel VBScript program

          'given two extensions, deletes all files in the current directory that have the second extension but only if a file with the same base name and the first extensions
          'also exists.


          Dim FSO
          Dim FileLoop,Folduse,outstream
          Dim Extension1,Extension2
          wscript.echo "HI!"
          If Wscript.arguments.count < 2 then
              ShowHelp
              WScript.Quit()
          End If
          Extension1 = Wscript.Arguments(0)
          Extension2 = WScript.Arguments(1)
          If Extension1 = "/?" then
              showhelp
              WScript.Quit
          end if
          Set FSO = CreateObject("Scripting.FileSystemObject")
          set outstream = FSO.getStandardStream(1)    'retrieve the stdout stream
          set folduse = FSO.GetFolder(FSO.GetAbsolutePathName(".") ) 'retrieve current directory.
          For each FileLoop in folduse.Files
              if FSO.getExtensionName(fileLoop.name) = Extension1 Then
                  'determine if a Doc file exists with the same base name.
                  'on error resume next
                  wscript.echo "found """ & fileloop.name & """. Finding:""" & FSO.GetBaseName(fileloop.name) & "." & extension2 & """..."
                  wscript.echo
                  on error resume next
                  if not folduse.Files(FSO.GetBaseName(fileloop.name) & "." & extension2) is nothing then
                      If Err.Number = 0 then
                     
                 
                          on error goto 0
                          Wscript.echo "deleting file, " & fso.getbasename(fileloop.name) & "." & Extension2
                      '    on error goto 0
                          folduse.Files(FSO.getbaseName(fileloop.name) & "." & extension2).Delete
                      else
                          wscript.echo """" & fso.getbasename(fileloop.name) & "." & Extension2 & """ not found."
                      end if 'err
                      end if
              end if

          next


          Sub showhelp
              Wscript.Echo "Extension verifier/Deleter"
              Wscript.echo "determines if files with the same basename and two different extensions exist,"
              Wscript.echo "And of so, Deletes one of them."
              Wscript.echo ""
              wscript.echo "Usage: ExtVdel.vbs <extension1> <Extension2>"
              wscript.echo "(might require CScript extvdel.vbs <extension1> <extension2>"
              Wscript.echo ""
              Wscript.echo "For example, ExtVDel txt doc"
              Wscript.echo "the second parameter is the extension whose file will be deleted."
          end Sub




          I won't go to in-depth into it, but for some reason I felt compelled to have it work for other extensions.
          just save it to the folder you wish to operate on, and run "Cscript extvdel.vbs txt doc" to get it to run on your files there. In the future if you need similiar functionality with other file types, you can just change the txt and doc portions of the commandline.


          I hope this works for you...


          And Dias- how was he rude? he only said anything even close to offensive after you contrived a new question out of a contextually removed sentence of one of his posts, and even then he only told it like it was :P that is, "mindless and irrelevant", and even if that was arguable, one thing definitely stands- it didn't help, and as far as I can see that was the whole reason he posted here in the first place (once again, :P)

          « Last Edit: June 28, 2008, 08:55:39 AM by BC_Programmer »
          I was trying to dereference Null Pointers before it was cool.

          Dias de verano

          • Guest
          Re: command line syntax
          « Reply #8 on: June 27, 2008, 01:02:37 AM »
          You are right I was out of order and I apologise.

          I hope this might make up for it in a small way

          I called it dnam.bat

          Code: [Select]
          @echo off
          REM Find files with same name but 2 extensions
          REM 2 parameters from command line
          REM %1 extension to look for & keep
          REM %2 extension to look for & kill
          REM E.g. dnam doc txt
          REM For each doc file delete a txt file
          REM that has same name part, if it exists
          set ext1=%1
          set ext2=%2
          for /f "delims==" %%A in ('dir /b /a-d *.%ext1%') do (
             if exist "%%~nA.%ext2%" (
             echo found %%A. Deleting %%~nA.%ext2%
             del %%~nA.%ext2%
             )
          )
          « Last Edit: June 27, 2008, 03:48:10 AM by Dias de verano »

          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: command line syntax
          « Reply #9 on: June 27, 2008, 10:45:02 AM »
          I couldn't think of a way to do this with a batch file

          Call me old fashioned- I haven't read up on these new thingies they added for batch commands and such- I just go with what I know for DOS 6.0



          Mine may be longer, but, do I get points for having it look more complicated? I wasted a good hour learning the WSH objects just to make it... and I just read it over...

          Code: [Select]
          set outstream = FSO.getStandardStream(1) 'retrieve the stdout stream
          why the heck did I put that there? ??? Completely pointless...



          « Last Edit: June 27, 2008, 11:36:05 AM by BC_Programmer »
          I was trying to dereference Null Pointers before it was cool.

          Dias de verano

          • Guest
          Re: command line syntax
          « Reply #10 on: June 27, 2008, 11:11:58 AM »

          Mine may be longer, but, do I get points for having it look more complicated? I wasted a good hour learning the WSH objects just to make it... and I just read it over...


           :)

          I deliberately made mine verbose but you can fit it all in one line

          Code: [Select]
          for /f "delims==" %%A in ('dir /b /a-d *.%1') do if exist "%%~nA.%2" del "%%~nA.%2"&& echo deleted %%~nA.%2
          Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.

          llmeyer1000



            Intermediate

            Thanked: 1
            Re: command line syntax
            « Reply #11 on: June 27, 2008, 11:18:53 AM »
            Hey BC,
            Please take a look at your last post. (Reply #9)
            It has an extra end quote symbol at the end of the message.
            I think that is why the screen is so wide.
            Please modify & correct.
            Thanks!  ;)


            Call me old fashioned- ... I just go with what I know for DOS 6.0

            I certainly wouldn't consider your VBScript to be "old fashioned" I am way behind on newer DOS batch programming also, and have a hard time following the loops that Dias creates, but the VBScript is even more difficult for me to follow. You must have spent a considerable amount of time learning it.  :o

            I personally favor sticking with the batchfile programming if at all possible, because of the fact that most of the "mainstream" antivirus software throws up errors when you run VBScript (like sendkeys). Yes, you can click that it's OK to run it, but the message will scare the "H" out of most users. They will think that you have infected their computer. While that is not true, the average user will not be able to handle the error message without a lot of panic.

            BC_Programmer


              Mastermind
            • Typing is no substitute for thinking.
            • Thanked: 1140
              • Yes
              • Yes
              • BC-Programming.com
            • Certifications: List
            • Computer: Specs
            • Experience: Beginner
            • OS: Windows 11
            Re: command line syntax
            « Reply #12 on: June 27, 2008, 11:58:24 AM »
            Hey BC,
            Please take a look at your last post. (Reply #9)
            It has an extra end quote symbol at the end of the message.
            I think that is why the screen is so wide.
            Please modify & correct.
            Thanks!  ;)

            Fixed. I think. still looks wide to me though, not sure.


            I certainly wouldn't consider your VBScript to be "old fashioned" I am way behind on newer DOS batch programming also, and have a hard time following the loops that Dias creates, but the VBScript is even more difficult for me to follow. You must have spent a considerable amount of time learning it.  :o
            I didn't spend any time learning VBScript per se, but rather Visual Basic 6.0, if that Script makes your head spin, I'd hate to see the mess when you view the code in the Class module I felt compelled to attach... You can't do anything with it, since you don't have the evaluation Library, to which the class is just a PLUGIN. "just" a plugin. performs the core operations/Functions for the parser itself. Imagine, if you will, some of THAT String parsing. :)

            I personally favor sticking with the batchfile programming if at all possible, because of the fact that most of the "mainstream" antivirus software throws up errors when you run VBScript (like sendkeys). Yes, you can click that it's OK to run it, but the message will scare the "H" out of most users. They will think that you have infected their computer. While that is not true, the average user will not be able to handle the error message without a lot of panic.

            that's the main reason I tried to write a batch program first. I don't know any of this new-fangled batch stuff, so I couldn't figure out a way to do it in my (comparatively limited) DOS 6.0 Batch knowledge. I think I got to, "For %%P in (*.txt) do"... and then I realized, that I couldn't do string manip. So I started a Script. That was my very first shell script :)

            [recovering disk space -- attachment deleted by admin]
            I was trying to dereference Null Pointers before it was cool.

            Dias de verano

            • Guest
            Re: command line syntax
            « Reply #13 on: June 27, 2008, 12:02:21 PM »
            I didn't spend any time learning VBScript per se, but rather Visual Basic 6.0, if that Script makes your head spin, I'd hate to see the mess when you view the code in the Class module I felt compelled to attach... You can't do anything with it, since you don't have the evaluation Library, to which the class is just a PLUGIN. "just" a plugin. performs the core operations/Functions for the parser itself. Imagine, if you will, some of THAT String parsing. :)

            Like I said,

            Quote
            Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.

            llmeyer1000



              Intermediate

              Thanked: 1
              Re: command line syntax
              « Reply #14 on: June 27, 2008, 12:47:41 PM »
              BC, It looks like Reply #9 is OK now, but there is still something wrong somewhere, making the screen so wide. It's probably something I did in one of mine, but I can't find it. I don't have time to look for it anymore. (It could be anywhere. When I found your extra end quote code, I thought that had to be it.)

              Help! Someone.

              Dias de verano

              • Guest
              Re: command line syntax
              « Reply #15 on: June 27, 2008, 12:51:27 PM »
              The thread is not extra wide for me either in Firefox 3 or IE6.

              BC_Programmer


                Mastermind
              • Typing is no substitute for thinking.
              • Thanked: 1140
                • Yes
                • Yes
                • BC-Programming.com
              • Certifications: List
              • Computer: Specs
              • Experience: Beginner
              • OS: Windows 11
              Re: command line syntax
              « Reply #16 on: June 27, 2008, 12:55:08 PM »
              I didn't spend any time learning VBScript per se, but rather Visual Basic 6.0, if that Script makes your head spin, I'd hate to see the mess when you view the code in the Class module I felt compelled to attach... You can't do anything with it, since you don't have the evaluation Library, to which the class is just a PLUGIN. "just" a plugin. performs the core operations/Functions for the parser itself. Imagine, if you will, some of THAT String parsing. :)

              Like I said,

              Quote
              Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.

              Call me dense but I don't see what my quote has to with yours there... Can you spell it out? lol
              I was trying to dereference Null Pointers before it was cool.

              Dias de verano

              • Guest
              Re: command line syntax
              « Reply #17 on: June 27, 2008, 01:07:24 PM »
              Call me dense but I don't see what my quote has to with yours there... Can you spell it out? lol

              For routine file stuff:

              VB stuff=complex + cumbersome (bad)

              Batch=simple + compact (good)







              BC_Programmer


                Mastermind
              • Typing is no substitute for thinking.
              • Thanked: 1140
                • Yes
                • Yes
                • BC-Programming.com
              • Certifications: List
              • Computer: Specs
              • Experience: Beginner
              • OS: Windows 11
              Re: command line syntax
              « Reply #18 on: June 27, 2008, 06:39:29 PM »
              Call me dense but I don't see what my quote has to with yours there... Can you spell it out? lol

              For routine file stuff:

              VB stuff=complex + cumbersome (bad)

              Batch=simple + compact (good)









              OK I see. I'd put some rebuttal here to simply defend my favourite programming language but the fact remains that when one knows how to make a "Simple & compact" Batch file for routine file stuff it is much better then a VBScript program for the same purpose.

              But one must admit that VBScript is a much better solution then a C++ program :)
              I was trying to dereference Null Pointers before it was cool.

              Dias de verano

              • Guest
              Re: command line syntax
              « Reply #19 on: June 27, 2008, 11:40:39 PM »
              But one must admit that VBScript is a much better solution then a C++ program :)

              Well, yes, that is something that we can agree on, but I suppose I should confess that I have never really got my head around OOP, so my preferred VB era is that of VB6 and its script sibling.

              llmeyer1000



                Intermediate

                Thanked: 1
                Re: command line syntax
                « Reply #20 on: June 28, 2008, 07:44:45 AM »
                Dizzzy,  I think that you have the answer to your problem in Reply #8 and a one line version of it in Reply #10.
                I prefer the one line version myself, but the split line version is supposed to be easier to read. Please let us know if you were able to implement any of the suggestions. Thank You in advance!  :)


                Please ... forgive me getting so far off your subject line, (I hope that this isn't construed as hijacking, as I think your question has been answered already.), but I would like to look further into the reasons for the wide screen display issue on this post.

                The thread is not extra wide for me either in Firefox 3 or IE6.

                That's interesting! Because I have a scroll bar at the bottom in "Internet Explorer 7   -   Version: 7.0.5730.13".
                I have to use the scroll bar to read all the replies in this post because the lines are about an inch(25-30 mm) too long for the screen. Dias, does your comment mean that you do not have a scroll bar to view the balance of the line(s).

                It seems that if there is one problem in one post on this site, that all replies on that page are affected. It is interesting to note that if I view only page 2 the posts on that page are OK, but if viewed under "ALL", they are wide also.

                I think(correction know) that it is caused by this line in Reply #7

                Code: [Select]
                                                wscript.echo "found """ & fileloop.name & """. Finding:""" & FSO.GetBaseName(fileloop.name) & "." & extension2 & """..."

                The line was preceded by 2 tab symbols, followed by a long line of code.
                I substituted 32 spaces in place of the 2 tabs as a test.

                I may be wrong, but I don't think that this site likes tabs, at least not in Version 7 of IE. It should be noted that you cannot type a tab charactor on this site. The only way to get one here is by pasting it in.

                CORRECTION:
                I am not wrong ... I am positive that this site does not handle tabs properly at least in IE: Version 7.

                The test code above previews perfectly as shown with the 32 spaces, but when I copy-paste 2 tabs in place of the spaces, the preview goes haywire. It appears that with the tabs in the code, the site is unable to word wrap, while it is OK with the spaces.

                One of 2 things needs to happen.
                1. Nathan should look into fixing the tab issue on this site.
                2. We should avoid pasting tabs into code on this site.

                Obviously, number 1 is the preferred solution! (Are you listening Nathan?)  ;)

                But, in the meantime, BC, would it be possible for you to go back to Reply #7 and replace the 2 tabs on the long line with 32 spaces. It seems to affect only long lines in my tests, so it may not be necessary to do that to every line to fix the screen in this post. Also the problem does not occur in the message body, only within code.

                We really need to prove or disprove the results of my tests, to give Nathan the right information, so that he can work out a solution.

                Dias de verano

                • Guest
                Re: command line syntax
                « Reply #21 on: June 28, 2008, 08:27:18 AM »

                The thread is not extra wide for me either in Firefox 3 or IE6.

                That's interesting! Because I have a scroll bar at the bottom in "Internet Explorer 7   -   Version: 7.0.5730.13".
                I have to use the scroll bar to read all the replies in this post because the lines are about an inch(25-30 mm) too long for the screen. Dias, does your comment mean that you do not have a scroll bar to view the balance of the line(s).

                I confirm that I do not have to use a horizontal scroll bar (there isn't one appearing). The whole width of the page is visible. I am using a 17 inch LCD monitor at its native resolution of 1280 x 1024 and in Firefox 3 with page zoom set to default (100%) I can see the blue vertical outline borders which are (gets ruler) approx 9mm in from the left screen edge and right vertical scrollbar respectively. This is both in single page view or "all". This is the case both in Firefox 3.0 and IE 6.0.2900.xpsp.080413-2111.

                Here is a screen shot scaled down to 1000 x 800










                « Last Edit: June 28, 2008, 08:51:25 AM by Dias de verano »

                BC_Programmer


                  Mastermind
                • Typing is no substitute for thinking.
                • Thanked: 1140
                  • Yes
                  • Yes
                  • BC-Programming.com
                • Certifications: List
                • Computer: Specs
                • Experience: Beginner
                • OS: Windows 11
                Re: command line syntax
                « Reply #22 on: June 28, 2008, 09:10:03 AM »
                I replaced all tab characters in that code with four spaces. I don't notice anything weird in my version of IE.


                Also, I don't think it is the site handling tabs badly, since it works fine in Firefox and IE6. Rather MS probably changed the way tabs are handled (likely with some proprietary CSS extension as well, no doubt))
                But one must admit that VBScript is a much better solution then a C++ program :)

                Well, yes, that is something that we can agree on, but I suppose I should confess that I have never really got my head around OOP, so my preferred VB era is that of VB6 and its script sibling.

                VB6 has Class modules :). Took a while to learn, but now I have a large collection of reusable objects I can toss into any of my VB programs. I have .NET 2005, but it isn't VB anymore-

                what I should have specified is VBScript is a better solution then essentially any compiled program. Somehow, "Here, stranger, run this executable on your computer. Oh, but first disable your antivirus", seems less then helpful :)

                With C++ it isn't really the classes I have trouble getting my head around, it's the fact that the whole "++" of C++ is just a huge kludge on top of C. Also, I can't stand that over 90% of my code in C++ is just for data structures and pedantic memory management that really shouldn't be necessary. Thus my 5 year stint with VB6. Why, I often use the RtlMoveMemory function, so I can perform unnecessary memory management in VB instead of C++ anyway :)
                I was trying to dereference Null Pointers before it was cool.

                Dias de verano

                • Guest
                Re: command line syntax
                « Reply #23 on: June 28, 2008, 09:13:50 AM »
                I mainly use VB6 as a procedural language, sort of like QBasic for Windows.

                BC_Programmer


                  Mastermind
                • Typing is no substitute for thinking.
                • Thanked: 1140
                  • Yes
                  • Yes
                  • BC-Programming.com
                • Certifications: List
                • Computer: Specs
                • Experience: Beginner
                • OS: Windows 11
                Re: command line syntax
                « Reply #24 on: June 28, 2008, 09:31:06 AM »
                I mainly use VB6 as a procedural language, sort of like QBasic for Windows.

                I was doing that for a while after going straight from VB2 (which had no class modules) to VB6 (which does). I didn't really understand the whole concept of a class module, but then I made a few activeX controls, and the idea of the class module suddenly "clicked". speaking of classes and controls and such, ever been to VBAccelerator.com? I was working on a few controls that performed (or were intended to perform) what those controls do (namely the commandbar control). Needless to say development was frozen when I discovered the VBAccelerator versions.
                I was trying to dereference Null Pointers before it was cool.

                llmeyer1000



                  Intermediate

                  Thanked: 1
                  Re: command line syntax
                  « Reply #25 on: June 28, 2008, 01:49:36 PM »
                  I confirm that I do not have to use a horizontal scroll bar (there isn't one appearing). The whole

                  width of the page is visible. I am using a 17 inch LCD monitor at its native resolution of 1280 x

                  1024 and in Firefox 3 with page zoom set to default (100%) I can see the blue vertical outline

                  borders which are (gets ruler) approx 9mm in from the left screen edge and right vertical scrollbar

                  respectively. This is both in single page view or "all". This is the case both in Firefox 3.0 and IE

                  6.0.2900.xpsp.080413-2111.

                  I do not think we can blame it all on my monitor/resolution settings, although that may be a

                  factor since my resolution is set on only 1024 x 768 on my 17 inch monitor.

                  The thing is, now that BC has replaced all of the tabs, my display is perfectly normal, with all the

                  same settings still in place.

                  I replaced all tab characters in that code with four spaces. I don't notice anything weird in my

                  version of IE.

                  I will test out my tab theory again:

                  Here is BC's line of code as currently posted with 8 spaces, instead of the 2 tabs as before.
                  Code: [Select]
                          wscript.echo "found """ & fileloop.name & """. Finding:""" & FSO.GetBaseName(fileloop.name) &

                  "." & extension2 & """..."

                  Preview is normal!

                  Here is BC's line of code as it was earlier posted with 2 tabs, instead of the spaces.
                  Code: [Select]
                  wscript.echo "found """ & fileloop.name & """. Finding:""" &

                  FSO.GetBaseName(fileloop.name) & "." & extension2 & """..."

                  This is totally strange:
                  Now, the preview is normal, except, the 2 tabs that I copied from notepad in place of the spaces are being ignored.

                  I give it up for now, but I will state this:
                  There is definitely something weird going on with tabs here!  ???  ???  ???

                  Dizzzy

                    Topic Starter


                    Greenhorn

                    Re: command line syntax
                    « Reply #26 on: June 30, 2008, 09:22:56 PM »

                    Mine may be longer, but, do I get points for having it look more complicated? I wasted a good hour learning the WSH objects just to make it... and I just read it over...


                     :)

                    I deliberately made mine verbose but you can fit it all in one line

                    Code: [Select]
                    for /f "delims==" %%A in ('dir /b /a-d *.%1') do if exist "%%~nA.%2" del "%%~nA.%2"&& echo deleted %%~nA.%2
                    Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.


                    Okay, Dias. Thanks for the command line code. I'm sorry my mindless and irrelevant comment came off as rude. Guess I was expecting this forum to be more like a grand jury than a jam session.  :o

                    And thanks BC for all the effort to do this with filesystemobject scripting. My whole reason for wanting to avoid doing it that way is that if you include it in the program then everything else has to stop until it is done and if you make an executable out of it and then call it then almost the same thing. Even if you schedule it the system can slow down so a batch file to do it with commands is the only way to go.

                    As for the extra wide screen its gone in this post reply mode. ...and now in view mode as well.