When running a bat file through Landesk it doesn't always react the same as just being on the machine and running the bat file.
I going to guess either C:\Microsoft Office does not exist and it can't move it there without the folder already existing or it doesn't know if in the first line c:\windows\system32\i386\applications\microsoft office is a file or folder.
"It doesn't always"?? So sometimes it does and other times it doesn't? That doesn't seem ideal at all ...
You're correct "C:\Microsoft Office" folder doesn't exist - Why would I have to create the folder when the MOVE command is simply relocating it; seems redundant to create said folder...call the bat file to move the MS office folder to the location of the created MS office folder??
I actually just created a VBS just to test a different methodology...This time just simply creating a VBS that simply moves the folder from its currently location to its new at C root. The VBS works fine and does this as I tested it before having LANDesk deploy it - But when I ask LANDesk deploy it - It comes back as SUCCESSFUL but it actually didn't complete the task.
Download PSEXEC.exe if you don't already have it. Put it in your root dir. bring up a command prompt, change to root dir and type in psexec -i -s cmd.exe This brings up another command window that runs under the system account. Then change to dir where the batch file is and type it in, exp John.bat.
I ran the first line of your batch file in this way and it said cannot find the file specified.
Sorry MrGadget I guess I wasn't clear on a few things - The folder "C:WINDOWS\System32\i386\Applications\Microsoft Office" is always present on our machines =] It's where we keep files in case something may need to be re-installed on our image. So yes it's not going to be on your machine, but it's on all the ones we deploy.
Are you on a x64 OS? Than don't forget in your defined Software Distribution Package in the Console to check the 'Run as 64-bit on 64-bit OS's' checkbox option. Than save, close and re-schedule the deployment or rightclick on your package and choose Reset Package Hash.
'Doesn't always' really means that because the batch file runs as local system rather than a standard user, behaviours can be different to what is expected. Also, because the interface is suppressed, a message popping up may not be noticed.
You say the batch file isn't being executed. Can we go a little fursther on that if Frank's suggestion doesn't do the trick?
When you send this with LANDesk, what is the result of the task?
What is you have the batch file start with a 'dir > output.txt' command? Do you see the contents of the directory written to the text file?
I'd like to know if the batch is launched at all or if it is an issue with your commands.
Also, a nice easy way to launch a command prompt as local system without another tool like PSEXEC is to use LANDesk Remote Control and the Remote Execute function to launch CMD.EXE. Providing you have a remote control setting that allows 'Run as Administrator' then it has the same effect.
In there, change directory to the location of the downloaded batch file and run it to see what messages you get for each command line.
MarXtar Ltd/MarXtar Corporation
LANDesk Expert Solution Provider
The One-Stop Shop for LANDesk Enhancements
Update - New Stand-Alone State Notifier Console for Service Desk Operators
Update - State Notifier now detects machine and user Idle states
Update - WoW & State Notifier now integrate for even more functionality
Ok so I got the file moving after re-writing my Vbs...now when I push it out - It performs the first part of it, moving the file, but doesn't perform the last line of running:
'on error resume next
objFSO.MoveFolder "C:\WINDOWS\System32\i386\Applications\Microsoft Office","C:\WINDOWS\System32\i386\Applications\MicrosoftOffice"
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "cmd /c C:\MicrosoftOffice\Setup.exe /config C:\MicrosoftOffice\Standard.WW\Config.xml"
We've tested this and it works flawlessly on the system...but LANDesk doesn't want to perform the last part...and it comes back as successful after using the PUSH distribution method....
Thoughts? And thanks again!
In my opinion LANDesk runs vbs Scripts in cscript environment, so wscript objects dont work.
In my environment i only use AutoIT for distribution, because here you have many many many functions for Software packaging und distribution.
Here is your script in AutoIT:
$error = RunWait("C:\MicrosoftOffice\Setup.exe /config C:\MicrosoftOffice\Standard.WW\Config.xml","C:\MicrosoftOffice\",@SW_HIDE)
With this Script you get also an errorlevel to your LANDesk Console
Using AutoIT do you comple it as an exe and then use LANDesk to build the package as an exe? Or are you still building it as a Windows Script Host package?
You would compile the script to an EXE and distribute it as an executable package.