• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Auto running .bat / batch file after imaging

    Scheduled Pinned Locked Moved Unsolved
    FOG Problems
    3
    4
    905
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rivaldydwi
      last edited by

      Hello everyone, can you help me?
      I just created .bat / batch file, and I already tried that file, and that fine/running smoothly. And now, I put on Snapin.

      Just want to ask, what a best to fill up “Snapin Run With” and “Snapin Run With Argument” for .bat file, if I want to auto-running after finishing imaging.

      it’s just a simple script for auto-add printer.

      Thanks

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @rivaldydwi
        last edited by

        @rivaldydwi I can’t help you with snapins since I don’t use them, but windows itself has a spot to place a batch file that will run just after OOBE/WinSetup and before the first login prompt is displayed.

        For this auto execution of the batch file to work you must sysprep your image. If you use sysprep them you can create a batch file called setupcomplete.cmd and place it in a special location. If windows finds that batch file in that location it will run it. Google “windows setupcomplete.cmd” and it will give you directions where to save the file and its exact naming requirements.

        The second place you can use if your commands need to have an active desktop is in the unattend.xml file. You can configure the unattend.xml file to auto login as an administrator account, X number of times. There is a section in the the unattend.xml file for firsts run actions. You can have it run 20 different commands if you want. Typically I will set the auto login count to 1 and then the last step in the first run section is to run “shutdown -r -t 0” to reboot the computer.

        I know its not what you are looking for with the snapins, but this is an alternate “windows” way to go about it.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        R 1 Reply Last reply Reply Quote 0
        • R
          rivaldydwi @george1421
          last edited by

          @george1421 Hi George, thanks for helping. At first, I also thought the same thing. I can put it on unattend.xml or with OOBE.

          But I think it’s better if I put it on snapin because I have 2 different .bat files. And for the some case, I just deploy by snapin on FOG.

          Just want to know, what the best “Run With” and “Argument” to put in snapin.

          Tom ElliottT 1 Reply Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott @rivaldydwi
            last edited by

            @rivaldydwi Snapins are utilities to run a script, install a program, or what have you…

            Generally, speaking, you would use the Snapin Run With of cmd /c with .bat scripts, but this isn’t strictly necessary.

            .bat scripts ARE executable by nature and can be completely void ofr SRW/SRWA.

            If your bat file is expecting its own arguments, this is what you would run Snapin Run With Argument.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post

            145

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project