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

Author Topic: Batch Programs Thread.  (Read 647877 times)

0 Members and 2 Guests are viewing this topic.

Salmon Trout

  • Guest
Re: Batch Programs Thread.
« Reply #615 on: June 29, 2018, 08:22:06 AM »
It's called common curtsy

Courtesy?

JoshCM



    Greenhorn

    • Experience: Familiar
    • OS: Windows 10
    Re: Batch Programs Thread.
    « Reply #616 on: June 29, 2018, 11:36:32 AM »

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Batch Programs Thread.
    « Reply #617 on: June 29, 2018, 12:29:38 PM »
    Salmon said back in January... Did a ghost press the power button?

    Not rezzing this, but just sharing that WOL has been known to be a problem at times with PC's getting a WOL signal and starting themselves. I had a Zotac Mini ITX build that kept turning itself on. It wasn't until I disabled WOL that the problem was solved. The guy putting a batch into startup to check to see if he is there and if no response after a count down to force shutdown the system likely has WOL enabled and its getting triggered to start. Disabling WOL will probably fix this without the batch needed.

    Salmon Trout

    • Guest
    Re: Batch Programs Thread.
    « Reply #618 on: June 29, 2018, 12:43:16 PM »
    Nope.
    Your spelling needs attention, as well as your manners.

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: Batch Programs Thread.
    « Reply #619 on: June 29, 2018, 04:38:18 PM »
    A curtsy is grabbing your dress corners and doing a 3/4 kneel...
    " Anyone who goes to a psychiatrist should have his head examined. "

    Salmon Trout

    • Guest
    Re: Batch Programs Thread.
    « Reply #620 on: June 30, 2018, 12:34:52 AM »
    A curtsy is grabbing your dress corners and doing a 3/4 kneel...
    Interestingly, curtsy (noun/verb: knee bend) can be spelled curtsey and courtesy, but courtesy (noun: politeness) has only one spelling.

    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: Batch Programs Thread.
    « Reply #621 on: June 30, 2018, 01:32:31 AM »
    Interestingly, curtsy (noun/verb: knee bend) can be spelled curtsey and courtesy, but courtesy (noun: politeness) has only one spelling.

    Curtsey's with respect.
    I was trying to dereference Null Pointers before it was cool.

    JoshCM



      Greenhorn

      • Experience: Familiar
      • OS: Windows 10
      Re: Batch Programs Thread.
      « Reply #622 on: July 02, 2018, 05:46:54 AM »
      Your spelling needs attention, as well as your manners.
      My bad manners were because of someone else who also had bad manners. Although I made a spelling error in that post, I managed to get though college on the Dean's list. So I'm satisfied with my level of education at this time. Trolling is a waste of your time. There is so much to be learned. There is so much to see. So many experiences to be had. Get out there and make it happen man.

      Brentrubin



        Newbie

        • Experience: Beginner
        • OS: Windows 10
        Re: Batch Programs Thread.
        « Reply #623 on: October 01, 2018, 08:12:33 PM »
        Can anyone help me make this script work?

        I'm making this simple program to use at work because I multiply stuff by the same number, all day, every day.

        I want to be able to enter a variable and multiply it by 1.2

        See below for code

        :cost
        cls
        echo.
        echo.
        echo.
        echo.
        echo.
        echo Please enter the freight cost provided from AllStates WorldCargo website.
        echo.
        set /P num1multiply=
        echo.
        set a=1.2
        echo.
        set /A Ans=%num1multiply% * %a%
        echo.
        echo The cost is: %Ans%
        echo.
        pause
        exit

        Can anyone please help me make this work?

        I keep getting "missing operator" message

        Thanks!

        nil

        • Global Moderator


        • Intermediate
        • Thanked: 15
          • Experience: Experienced
          • OS: Linux variant
          Re: Batch Programs Thread.
          « Reply #624 on: October 01, 2018, 08:49:11 PM »
          Unfortunately MS-DOS doesn't do floating point operations. If you want precise math you'll have to use another scripting language, like VBScript or Python.

          Python 3 can be downloaded at https://www.python.org/downloads/release/python-370/. (Scroll down for windows installer)

          Your script in Python 3:

          Code: [Select]
          prompt = "Please enter the freight cost. "
          multiplicand = float(input(prompt))
          multiplier = 1.2
          product = multiplicand * multiplier
          print("The cost is", product)
          exit(0)

          save as (for instance) cargo.py, and run with python cargo.py

          example operation:

          Code: [Select]
          Please enter the freight cost. 1.618                     
          The cost is 1.9416

          Hope this helps


          Do not communicate by sharing memory; instead, share memory by communicating.

          --Effective Go

          brunoteta



            Newbie

            • Experience: Beginner
            • OS: Windows 10
            Help .batch paint, cut
            « Reply #625 on: March 14, 2019, 07:48:42 PM »
            Hi, need help to create a .batch file to open paint(or oder image editor), one or more images, cut top left corner (custom width x height), select "pick color" tool to fill the hole, save and close.

            its possible? thanks

            Squashman



              Specialist
            • Thanked: 134
            • Experience: Experienced
            • OS: Other
            Re: Help .batch paint, cut
            « Reply #626 on: March 16, 2019, 09:15:58 PM »
            Hi, need help to create a .batch file to open paint(or oder image editor), one or more images, cut top left corner (custom width x height), select "pick color" tool to fill the hole, save and close.

            its possible? thanks
            No.  Batch files cannot interact with Graphical User Interfaces.

            Geek-9pm


              Mastermind
            • Geek After Dark
            • Thanked: 1026
              • Gekk9pm bnlog
            • Certifications: List
            • Computer: Specs
            • Experience: Expert
            • OS: Windows 10
            Re: Help .batch paint, cut
            « Reply #627 on: March 17, 2019, 10:38:01 PM »
            No.  Batch files cannot interact with Graphical User Interfaces.
            True.
            The alternative is some kind of automation program that will invoke things like a human would. Either keystrokes or mouse movements.
            Here is a link that might be relevant:

             5 best programs to automate PC tasks


            He includes AutoHotkey
            Here is the CH archive about AutoHotKey:
            https://www.computerhope.com/jargon/a/autohotkey.htm
            AutoHotkey is a fantastic free and open source Microsoft Windows tool that allows you to create macros, scripts, and automate frequently performed tasks on your computer. For example, Computer Hope uses this tool daily to help answer common questions asked in e-mail quickly and perform other common repetitive tasks.
            It does have a learning g curve. But it is worth the effort.  :)

            Salmon Trout

            • Guest
            Re: Batch Programs Thread.
            « Reply #628 on: March 18, 2019, 01:39:59 AM »
            There is a program called ImageMagick (spelled thus) which can do most or all of the OP's tasks from a script or the command line.

            Hackoo



              Hopeful
            • Thanked: 42
            • Experience: Expert
            • OS: Windows 10
            Re: Batch Programs Thread.
            « Reply #629 on: November 27, 2022, 07:48:13 PM »
            Hi  ;)
            I want to share with you this little batch : System_Info_HTML_Output.bat

            Code: [Select]
            @echo off
            CHCP 65001>nul
            Title System Info With HTML Output by Hackoo 2022
            Color 0B & Mode 57,3
            Set Systeminfo_TXT=%~dp0Systeminfo_TXT.txt
            Set Systeminfo_HTML=%~dp0systeminfo.html
            echo(
            systeminfo>"%Systeminfo_TXT%"
            call :CreateHTMLtable "%Systeminfo_TXT%" "%Systeminfo_HTML%"
            Start "" "%Systeminfo_HTML%"
            Exit /b
            ::------------------------------------------------------------------------------------------------------------------------------------------------------
            :CreateHTMLTable <inputfile> <outputfile>
            >"%~2" (
            echo ^<!DOCTYPE HTML PUBLIC
            echo "-//W3C//DTD HTML 4.01 Transitional//EN"
            echo  "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"^>
            echo ^<HTML^>
            echo ^<HEAD^>
            echo ^<META HTTP-EQUIV="Content-Type"
            echo CONTENT="text/html; charset=utf-8"^>
            echo ^</HEAD^>
            echo ^<BODY^>
            echo ^<style type="text/css"^>
            echo .tftable {font-weight: bold;font-size:16px;color:#333333;width:100%;border-width: 1px;border-color: #bcaf91;border-collapse: collapse;}
            echo .tftable th {font-size:16px;background-color:#ded0b0;border-width: 1px;padding: 8px;border-style: solid;border-color: #bcaf91;text-align:left;}
            echo .tftable tr {background-color:#e9dbbb;}
            echo .tftable td {font-size:16px;border-width: 1px;padding: 8px;border-style: solid;border-color: #bcaf91;}
            echo .tftable tr:hover {background-color:#ffffff;}
            echo ^</style^>
            echo ^<center^>^<table class="tftable" border="1"^>
            )
            @for /f "tokens=1,* delims=:" %%a in ('Type "%~1"') do (
            >>"%~2" echo ^<tr^>^<td^>%%a^</td^>^<td^>%%b^</td^>^</tr^>
            )
            >>"%~2" (
            echo ^</table^>
            echo ^</BODY^>
            echo ^</HTML^>
            )
            Exit /B
            ::------------------------------------------------------------------------------------------------------------------------------------------------------