I have created a batch file to install a wlan profile to our assets. When I run the bat file locally it installs the profile but runs as completed when run through BF.
I downloaded a folder from my C:\drive in the task wizard. The folder contained a wirelessprofile.xml file, a wlan.exe and the .bat file. The .bat file runs but a cmd window on my screen says it cannot locate the wlan.exe file yet the job finishes. Here is the content of the .bat file.
@echo off
echo Grabbing WLAN Interface…
For /F “skip=2 tokens=1,2” %%A IN (‘wlan.exe ei’) Do If “%%A”==“GUID:” set Interface=%%B
continue if {(size of it = 83135 AND sha1 of it = “acbc1530048d2d992746f4b127b08d300d222279”) of file “BCFStaffWirelessProfile.tmp” of folder “__Download”}
I moved your download statement to the top and changed it to a prefetch. Downloads always happen first so it’s a good idea to put them up top.
I changed from download to prefetch. Prefetch is a newer syntax that’s easier to author than download/continue if. It also better denotes that the download will happen first.
I changed the action to write out the batch script so I could use relevance substitution to insert the local path to wlan.exe.
I removed the ‘pause’ from the end of your script so it won’t require user interaction
I used ‘waithidden’ instead of ‘run’ to avoid showing UI to the end user and to make sure the script completes before the action finishes.
Jesse, Thanks for getting back to me so quickly. I was not able to run the action script. When I went to save it I received an Invalid Action Script/Unable to parse action script for Action1 line 1: Download name is invalid. Wlan.exe is in the tmp folder in BF.
Thanks. This is an interesting one. I run the script and it says completed. I don’t get any echo statements and the SSID doesn’t get installed although it will if I run the bat file outside of BF. I’m going to definitely post this SSID export/import for others as it’s been a bear for me and I am certain there are alot of people who would like to do a wlan profile import outside of AD.
You may need to run the batch script in the user context rather than the client context. Search the forum for RunAsCurrentUser.exe and you’ll find lots of examples.
Just a quick question. I can copy the wlan, xml, bat files to all the local machines to a temp folder. Can I launch the bcfstaff. bat file on the local machines (2000 of them) via BF. If that is possible I can remove the files via BF after the profile has been launched.
Relavence: exists file “bcfstaff.bat” of folder “C:\Temp”
Generally I wouldn’t recommend that route. Usually BigFix is the most efficient distribution mechanism, but if it’s easy for you and you don’t anticipate delivery issues, there’s nothing wrong with your technique. You can easily execute the batch file with the command you suggest. You still might need to use RunAsCurrentUser to get your expected behavior.
Thanks Jesse. I would rather use BF to run the job but after numerous attempts even using current user I cannot get it to run although it says completed. I think it is having issues making the wlan ei call. Interesting enough when I try to launch the bat file from the local machine via BF it starts as running in BF and stays in that state, even running as currwent user. I think I may have stumped the panel.
continue if {(size of it = 83016 AND sha1 of it = “c679901d4efe936ec4870d0a5b526eeed6d03e28”) of file “BCFStaffWirelessProfile.tmp” of folder “__Download”}