Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

The CommandReportImporter forms the basis of the script but the main issue for support teams is that you must specify which rptdef to import. I have written a short batch script which should eliminate this problem. This script relies on the fact that the newest rptdef will also be the most recently created file. The batch file makes a copy of the most recent file and saves it as 'Latest-Report.rptdef'. This is then imported by the CommandReportImporter:

 

[copy the following code to a notepad and save with .bat extension. You will need to change the USER, PASSWORD and sims.net path as necessary.]

 

c:
cd \ 
cd program files\sims\sims .net
SIMSLOAD.exe
del Latest-Report.rptdef /F /Q
for /F "usebackq" %%A IN (`dir /O:D /B Predefined_Reports*.rptdef`) do (
set FI=%%A
)
copy %fi% Latest-Report.rptdef
CommandReportImporter.exe /user:damon /PASSWORD:damon /report:"Latest-Report.rptdef"

 

The above code should be run after a Solus upgrade has completed. It can be launched from any machine but I would advise using the server. Unfortunately you cannot simply paste this on the bottom of your automated Solus script as the batch file will need to be written to wait for the solus upgrade to complete before it attempts to import the latest reports. The most straight forward method is to simply schedule this bat to run a few hours after the upgrade to allow Solus to complete. For those of you that are more technically minded, you can script your bat to wait for the Solus upgrade to end. I would advise simply using the sleep.exe from the Windows 2003 Resource kit:

http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en

 

Add the following command between the solus.exe and the simsload for a 2 hour pause (the parameter value is in seconds).

Sleep 7200

 

I've been looking at adding a wait command for solus to finish before launching the importer but the problem is that solus.exe launches solapp.exe and then exits. Due to this, the batch script continues with the commands as soon as solus.exe closes rather than waiting for the solapp. The workaround will probably need to use vbs or something like Auto-IT as I believe you can create a wait for window function. You could then launch the exe at the end of the solus automation. The exe would need to wait for the solapp window to close and then run the above batch script. If I find time over Easter I will create a file which can be used by support teams.

 

Please note: SIMSLOAD.EXE is launched prior to the CommandReportImporter.exe to ensure that the most recent report definition file is installed in the sims.net dir. As far as I remember, Solus does not automatically upgrade the client install on the server. If I'm proven wrong, you can remove simsload from the script.

 

I wrote this batch file very quickly today so I haven’t had a chance to test it thoroughly. There's not alot that can go wrong as far as I can see but I will produce an update and perhaps an installer soon so that it can be rolled out with ease by support teams if they choose to do so.

 

Hope this helps

Posted

Yes nice. I like the repeated assignments with /OD. Very sneak :)

 

The one problem you may have is that the script assumes SIMSLoad will always be successful.

 

Can SIMSLOad run without access to a GUI?

Posted

Thanks NG good point :)

 

I can't see a way to run simsload silently but perhaps this line would suffice:

 

start /wait S:\setups\SIMSApplicationSetup.exe /S {QuietMode} {NoServerApps} [sIMSDirectory]="S:\sims" [sIMSDotNetDirectory]="C:\Program Files\SIMS\SIMS .net"

 

Thus avoiding simsload completely. Thats assuming the rptdef is installed by SIMSApplicationSetup.exe

 

I'm not sure what happens if an error occurs whilst running the installer like that though so it may end up being the same result as a failed simsload.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...