Need help creating a batch file

Discussion in 'other software & services' started by pandlouk, Mar 17, 2010.

Thread Status:
Not open for further replies.
  1. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    Can someone assist me to create a batch file?

    Here is what I want to achieve:
    1. create an elevated command prompt so that users won't have to use the run as admin
    2.Run the files from the directory where the batch resides
    3.Identify if the OS is 32 bit or 64 bit
    4.If the OS is 32-bit then should execute
    If the OS is 64-bit then should execute
    1,2,3 work fine but I am stack in the 4th step.


    thanks in advance,
    Panagiotis
     
  2. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    What is wrong? bootsect is in an environment path, yes? Is it actually calling bootsect? Or is there an error in the parameters you are passing? I should think the logical error would be that the batch file is wishing to call a program that needs an explicit path declared.

    Can you pipe out /? to a text file, to make sure at least that the batch file gets to that point? Then you will narrow it down.

    I presume you have both bootsect32 and bootsect64 files in path?

    This does not look very hard, you are probably missing some small little thing.

    If you run that bootsect portion as a stand-alone script, you can 'call' it.

    I am sorry, but I cannot check (run) your script right now. Maybe I can in a day or two.

    Sul.
     
  3. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    Hi Sul,

    thank you for the help offering.
    At the end I decided to abbandon the script and to create 2 rar sfxs.
    https://www.wilderssecurity.com/showpost.php?p=1641574&postcount=1

    I am lasy when it comes to create batches and especially troubleshoot them... mostly because I do not remember most of the commands. :oops: :oops:

    Panagiotis
     
  4. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    This USED to be the site that was my favorite for dos/batch.
    home7.inet.tele.dk/batfiles/msdos7/

    It is either gone or down. Pity.

    You might look into AutoIt script. It has a lot of automation, and best of all you can compile the scripts into stand-alone executables. It is easy if you get dos, you can do AutoIt. Of course with a good .chm file, VBS can also accomplish a lot. Much more rigid syntax, but almost sure to work.

    Sul.
     
  5. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    Yes, probably from now on I think I will use AutoIt for complicated scripts.

    Panagiotis
     
  6. nanana1

    nanana1 Frequent Poster

    Joined:
    Jun 22, 2007
    Posts:
    947
    But many AV would detect AutoIt as a trojan (false positive ?) o_O
     
  7. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    UPX is sometimes detected as trojan. Avira used to do it a lot. Normally the newer versions of autoit will have to go through a period where AV will have to make corrections. Older scripts already compiled seem to be fine.

    I will remove an AV if it interferes with my own programs, erm, come to think of it, I have done that on a few occasions.


    Sul.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.