• Hi, I have created the following batch file:

    mkdir c:\AV
    copy [server]\public"AV Install"\setup.exe c:\AV\ /z /y
    cd c:\AV
    start /WAIT c:\AV\setup.exe /s /w

    I have created a normal snapin, chosen batch script, uploaded the file. but when I run the snapin task it says on the computer that it has started it, and then almost instantly finishes it.

    It created the folder, but did not copy the file, and obviously did not start the setup file, to install the program. Now I checked the snapin settings for this again and noticed it automatically put in a snapin argument of /C now from what I know this tells cmd.exe to run the command and terminate, so it would appear that it is running the first command and terminating, which explains why the folder is created and nothing us is followed.

    So I thought lets remove the argument /C and see what happens, well now it is saying the task is running and running and running, you get the picture however it does do anything in the bat file?!

    Am I missing something, or is there something I am not accounting for?

    Any help would be gratefully recieved.

    Kind Regards


  • Some options.

    1º Use a snapin pack including the executable.
    2º Put it in a ftp server and use a cmd ftp client to download it. (You can use the fog server/node as ftp and the built-in ftp client)

    This two solutions works!!!

  • @scottedwards54 If the installer is contained entirely in the one file, you could implement it as either a regular snap-in or a snap-in pack. The pack approach would be useful if files other than just the executable were involved, such as maybe a batch script in case the fog service couldn’t keep track of the installer process where the start invocation would for some reason or you wanted to do other things at the time of install. Altering the script to include setting up authentication to the smb share with net use would also be a solution, but could get substantially more involved depending on your environment, share configuration, and which editions of windows your clients are running.

  • @Sebastian-Roth Many thanks for the reply, that would explain it 🙂 how would I work around this, would this be something for a snapin pack?

  • Moderator

    @scottedwards54 On Windows the fog-client runs under the SYSTEM account. This will likely have no access to the UNC path share. Search the forums and you will find a few posts on this topic.

  • Hi Daniel,

    Thank you for your reply, I can confirm that this script works if you run it manually so I do not believe it to necessarily be a problem with the script itself just how the snapin is perhaps using it not entirely sure all new to the world of FOG :), and you can double quote only the section that has spaces in it and command prompt will read it correctly.

    I will try and dump the output to a file and see if that sheds anymore light

    Kind Regards,


  • I don’t think the copy command can find the file as specified. I have yet to come across any SMB path specifications that include the double quote character as part of the path. maybe you are intending to do something along the lines of :

    copy /z /y "\\[server]\public\AV Install\setup.exe" c:\AV

    edit: forgot the restartable flag, although I don’t know how useful it is in this context.
    edit: forums don’t like the double backslash

    I have also found it can be helpful to dump the output of a file to a log of some sort during testing, either in the snapin script or by modifying the snapin arguments.