Snapin without file / Just execute command?
-
First all, I would like to thank everyone for such a great product. I am new to FOG, but have tons of experience packaging/scripting applications for deployment using other Application Management Solutions (Altiris, SCCM, etc).
Anyways, I have been doing some testing and really do like the Snapins. However, I have noticed that there is not a simple way to just have it execute a command locally without attaching a “Snapin File”?
For reference, I wrap all applications in an “Install.vbs”. What this does in a nutshell is handle all of the heavy lifting and is location aware. So at the end of the day whatever deployment mechanism is used the command is the same: CScript.exe “Install.vbs” (of course the “Working Directory” or “Start-In” is also set at creation)
Anyways, is it possible to have a Snapin simply run the command like: CScript.exe “\%NetworkShare%%ApplicationFolder%\Install.vbs”; without having to attach any file?
I already have successfully tested that I can editing the “Install.vbs” so that it does set the variables to the network path, but in the end it would be preferable to just be able to call it directly and leverage the already scripted vbs.
Also, this would come in handy for quick configurations where one simply wanted to issue a command without having to make a Batch/VBS/PS1/Etc.
Apologies in advance for my long winded question and if this is already available that I simply overlooked.
-
@mirfster It’s currently not possible. Someone else before you asked for this also. The easiest thing to do is just put your command in a script and deploy that script. Going to ping @joe-schmitt to look at this though.
-
@wayne-workman Thanks for the quick response. For now, I will simply make a copy of my “Install.vbs” and name it “FogInstall.vbs” with the modifications.
-
I realize this is an oldie but as a feature request it made sense to me to just bump it rather than creating a new one.
I have a program installed that has a built-in uninstaller. I’d like to executeuninstall.exe /S
to remove it, however the snapin needs to add a file in order to do so. Guess I could just upload a script with this command in it but it seems much simpler to just allow running a command.
Thanks! -
@altitudehack The supported workaround would be to use 1 universal script that can just take the arguments of a command.
i.e. a simple powershell script like this[CmdletBinding()] param ( [string]$exe, [string]$argz ) start-process -filepath "$exe" -arguments "$argz"
There might be more needed there, but that’s the general idea.
Then you just use that same script each time you need it. Then lets say you call itrunCmd.ps1
you would make a snapin with the powershell template and that runCmd.ps1 (once uploaded once you can create snapins with the existing file)
In the snapin arguments field you would put something like-exe "C:\program files\some program\uninstall.exe" -argz "/S"
-
That’s awesome! I was hoping there was a simple workaround.
It does look like it completed successfully in seven seconds, but the process didn’t have the expected result. When I runUninstall.exe /S
manually the folder gets emptied. In this case, the files are still present.Any tips on increasing verbosity or leaving a log of what happened?
Thanks!
-
Haven’t really found a great fix here, I’d love to get some logging to work. But this seems to be working better than before. It moves the argument from the calling command and embeds it into the Snapin Arguments:
- Snapin Type: Normal Snapin
- Snapin Run With: powershell.exe
- Snapin File (exists): runCmd.ps1
- Snapin Arguments:
"%ProgramFiles%\FusionInventory-Agent\Uninstall.exe /S"
the command in runCmd.ps1 then no longer passes an argument so needs to be changed to:
start-process -filepath "$exe"