Results 1 to 8 of 8

Thread: Script

  1. #1
    Micks is offline Permanently Banned Last Online: 19-12-2021 @ 07:11 AM
    Member Since
    Dec 2006
    Age
    57
    Posts
    0

    Script

    Have a program I would like to silently install though would like the ability to install from it's own Dir without the need to specify it path or location for install?

    If I install from the root of C installs no problem.
    Manufacturer recommends installing as eg
    C:\"Mick.exe" /s /v"SERIAL=000000000000" -f1"C:\setup.iss"
    Any pointers from any scripting dudes is appreciated?

  2. #2
    Micks is offline Permanently Banned Last Online: 19-12-2021 @ 07:11 AM
    Member Since
    Dec 2006
    Age
    57
    Posts
    0

    Re: Script

    This is what I'd like to use but not working:
    "%~dp0Mick.EXE" /s /v"SERIAL=000000000000" -f1"%~dp0setup.ISS"

  3. #3
    QldKev is offline Forum Contributor Last Online: 07-06-2020 @ 10:19 AM
    Member Since
    May 2010
    Location
    Qld, Australia
    Posts
    1,025

    Re: Script

    When you say not working, why? Are you getting an error message?

  4. #4
    Micks is offline Permanently Banned Last Online: 19-12-2021 @ 07:11 AM
    Member Since
    Dec 2006
    Age
    57
    Posts
    0

    Re: Script

    Quote Originally Posted by QldKev View Post
    When you say not working, why? Are you getting an error message?
    Yeah Kev comes up in Cmd prompt "Mick.exe not recognized as an internal or external command, operable Prog. or batch file".

    Trying to have install from a temp Dir instead of a Network location or Root drive.
    It does install perfectly with code in 1st post.

  5. #5
    Rate's Avatar
    Rate is offline Account Suspended Last Online: 14-11-2014 @ 09:29 PM
    Member Since
    Dec 2001
    Location
    Melbourne, VIC
    Posts
    802

    Re: Script

    Hi Mick,

    At a very quick glance, it looks like when you're trying to call the executable, Windows can't find it.

    This could be due to a couple of reasons. Is the batch file you're running located in the same directory as Mick.exe?
    I haven't done a lot of Windows scripting, but I think %~dp0 refers to the directory and path of the executing script file... so if Mick.exe is not in the same directory, it won't find it.

    Some options to consider:
    - in the actual script, change directory to the location of Mick.exe before calling it
    - again in the script, modify the path environment variable to include the directory where Mick.exe is located

    I hope that gives you some ideas...

  6. #6
    SimonNQ is offline Forum Contributor Last Online: 26-11-2021 @ 11:56 AM
    Member Since
    Jun 2011
    Location
    Townsville
    Age
    55
    Posts
    317

    Re: Script

    The %~dp0 is passing the current directory of the bat file you just ran, you are then looking for a prohram called Mick.exe within that same directory. Same for your setup.iss file.

    So,
    if you executed the bat file from C:\Scripts your command above would read

    "C:\Scripts\Mick.EXE" /s /v"SERIAL=000000000000" -f1"C:\Scripts\setup.ISS"

    This will fail unless both Mick.exe and Setup.iss are both located in the C:\Scripts\ directory.

  7. #7
    jc_sv8's Avatar
    jc_sv8 is offline Fair Contributor to the Forums Last Online: 15-06-2025 @ 01:08 PM
    Member Since
    Mar 2004
    Location
    Perth
    Posts
    1,752

    Re: Script

    Usually most programs always unzip/deploy into the temp directory.

    You can use the system variable TEMP or TMP depending on where it was ported from (MS or Unix)

    In your script you can use mkdir %TEMP%\mydir to copy all of your files to your newly created mydir.
    Reference everything from that point and you don't need to create any directory paths or environment variables and all should be good.

  8. #8
    Micks is offline Permanently Banned Last Online: 19-12-2021 @ 07:11 AM
    Member Since
    Dec 2006
    Age
    57
    Posts
    0

    Re: Script

    Ok Guys very big thanks to Rate, Simon & JC the explanations that nailed it!
    Figured out I was trying to run the script by Elev Cmd prompt when I should have run it from a batch!
    All working good now. Just have to taskill the opening page of the prog to make it totally silent.
    Thanks again Mick

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Monaro symbol & script jpeg
    By YCV8 in forum Multimedia Exchange
    Replies: 4
    Last Post: 10-12-2010, 12:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •