CJSmith dot me

I dump stuff I find useful here

Category: Windows

Sage Line 500 V7.1 CSAgent TCR and Form appear to start but ports never open

Published / by Chris Smith / Leave a Comment

Recently we had this issue where after windows patches were applied, after a reboot the Sage Line 500 v7.1 Windows services no longer worked on our development and live servers. It was due to the Visual Studio dll msvcr71.dll being removed SYSWOW64 (32 Bit systems will be System32 and you can see in process monitor where the processes try to access the dll file and are unable to find the dll)

This can be copied back from a client Sage Line 500 install, as I found the dll was actually still registered

One possible cause I can think of is the registry entry for the dll in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs is set to 1, an installer upgrades a program to a newer version of Visual Studio and takes one away from the dll entry in the registry, where by it thinks it is no longer used and deletes the dll.

Populate Sage table opheadm with credit note information for Cindercone Magma to send to Tungsten/OB10

Published / by Chris Smith / Leave a Comment

The below stored proc is used to populate two Sage fields shipper_code2 and shipper_code3 in the Order Header Table.
Obiously if this is used already by another Sage Project do not use, as the fields won’t be updated.
Here I look 30 days backwards and at particular invoice customers (There is no point updating every invoice entry), for an initial run you may want to increase the amount of days on both update queries

Check the audit on Business Objects XIR3 SP7 for logons

Published / by Chris Smith / Leave a Comment

This is useful to see who is using their licenses which are very expensive. I tend to check every few months and look at 90 days.
Its a simple count excluding the System Account and look at a date range.
I have only run this against XIR3 SP7 where auditing has been enabled on an environment running Windows and Microsoft SQL Server (Obviously it can run on almost most OS and database configs).

I have no idea where Business Objects stores the user list, so unfortunatly I can’t easily use a join to show where users havent logged in.

In VBA strip out characters which cause TSQL to fail

Published / by Chris Smith / Leave a Comment

A simple way to strip out characters which can cause TSQL Code to break.
Assumes the SQL commannd is in sqlstatement and you are passing a variable in me.comment, before executing the code.

Sage EDI IN Intermediary Email

Published / by Chris Smith / Leave a Comment

I have found users don’t always read the logs from the Adaptus EDI Module anymore in Sage Line 500.
There are a few reasons why orders get stuck, the most common is a customer has sent a duplicate EDI file although one was caused by incorrect product supersession setup causing an endless loop.

Maintain regtrans-ms and blf files generated by Georgia UTS sessions

Published / by Chris Smith / Leave a Comment

A little script I schedule for servers using Georgia UTS.
Below I use Robocopy to move files older than 3 days, to avoid anyone currently logged in. For me I expect users to be logged on for no more than a day, active user files should therefore be untouched.

Force launch IE with a Shortcut

Published / by Chris Smith / Leave a Comment

I needed to force Windows 10 to open a web browser in IE for some internal applications as they still use ActiveX add-ins.
Rather simply instead of using a URL shortcut, use a standard shortcut calling IE and passing the URL as a parameter. Here I call the 32bit version of IE (As I don’t know of any add-ins for IE that would be used by most companies that are 64 bit)

Firefox supports the same type of shortcut

Disable Powerpoint 2016 extended display mode

Published / by Chris Smith / Leave a Comment

Credit: http://tips.timscomputer.com/disable-powerpoint-2013-extended-display-mode-via-registry/
Disable the extended display mode upon login, same as the link just modified the version from 15 to 16

Run the following as a batch file upon login

Windows 2008: Task Scheduler causes account lockout when policy locks account after one attempt

Published / by Chris Smith / Leave a Comment

I encountered a very odd issue where I was attempting to amend a scheduled task on a Windows 2008 R2 server. When attempting to amend to a “service” account it locked out immediately. This account has a policy where it is locked out if the password is incorrect once. After several attempts and having to unlock the account every time, we spotted that every time a task was changed two event log entries were added instead of one.
It turns out the Task Scheduler in Windows 2008/2008 R2 was causing this, it first attempts to login with a blank password and then a second attempt is made with the valid password.
This causes the below (An error has occured for task . Error message: The following error was reported: 2147944309.) as the first attempt locks the account out.

The Event Log also has the following entries

Rather annoyingly the fix is no longer available, it is now included in a Convenience Rollup available from Microsoft Support. I can’t however see any mention of it in this. Thanks to Andrew Bainger from ABF for pointing me towards this.

DBForms: Check and format email addresses from Sage Line 500/1000

Published / by Chris Smith / Leave a Comment

As the email field can sometimes not be used for the correct purpose I use a bit of code to look for an @ symbol and then a dot. If more than one email address is in I replace the comma with -t which is required by dbmailsend.
If using Sage Line 500/1000 the CustomerTable will be scheme.slcustm
I expect the DBForms def below to pickup the customer code already so there is only a lookup to the customers email address.