Crash executing script on Win 10 but not Win 7

I have this script that runs when I select Computer, it collapses the tree. It works fine on my desktop with Windows 7 but crashes on my laptop with Windows 10.

option explicit

' ComputerCollapse
' (c) 2016 Jerry
' This is a script for Directory Opus.
' See http://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.
' Called by Directory Opus to initialize the script

Function OnInit(initData)
	initData.name = "ComputerCollapse"
	initData.version = "1.0"
	initData.copyright = "(c) 2016 Jerry"
'	initData.url = "https://resource.dopus.com/viewforum.php?f=35"
	initData.desc = "Collapse all drives and folders when Computer selected"
	initData.default_enable = true
	initData.min_version = "12.0"
End Function

' Called after a new folder is read
Function OnAfterFolderChange(afterFolderChangeData)

	If afterFolderChangeData.result Then
		' DOpus.Output afterFolderChangeData.tab.path
		' Check if the path is Computer
		If Left(afterFolderChangeData.tab.path, 11) = "::{20D04FE0" Then

			'DOpus.Output "Found Computer"

			Dim objCmd
			Set objCmd = DOpus.CreateCommand
			objCmd.RunCommand("Go ROOT=collapse NOSCRIPT")
			objCmd.RunCommand("Go CURRENT EXPANDTREE NOSCRIPT")
			Set objCmd = Nothing
		End If
	End If

End Function

Was a crash dump generated?

Crash dumps sent to crashdumps@gpsoft.com.au

Email bounced back as undelivered. Is there another email address that I can send it to?

We have the dumps so no need to re-send.

Jon got the email, while I didn't. So it looks like the bounce was only for some of the addresses it gets routed to. Possibly a mail server rejecting the message due to anti-spam false positives.

Does this script work any better for you?

It may not make a difference, as I haven't been able to reproduce the crash yet, but it's worth a try:

option explicit

' ComputerCollapse
' (c) 2016 Jerry
' This is a script for Directory Opus.
' See http://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.
' Called by Directory Opus to initialize the script

Function OnInit(initData)
	initData.name = "ComputerCollapse"
	initData.version = "1.0"
	initData.copyright = "(c) 2016 Jerry"
'	initData.url = "https://resource.dopus.com/viewforum.php?f=35"
	initData.desc = "Collapse all drives and folders when Computer selected"
	initData.default_enable = true
	initData.min_version = "12.0"
End Function

' Called after a new folder is read
Function OnAfterFolderChange(afterFolderChangeData)

	If afterFolderChangeData.result Then
		' DOpus.Output afterFolderChangeData.tab.path
		' Check if the path is Computer
		If Left(afterFolderChangeData.tab.path, 11) = "::{20D04FE0" Then

			'DOpus.Output "Found Computer"

			Dim objCmd
			Set objCmd = DOpus.CreateCommand
			objCmd.SetSourceTab(afterFolderChangeData.tab)
			objCmd.AddLine("Go ROOT=collapse NOSCRIPT")
			objCmd.AddLine("Go CURRENT EXPANDTREE NOSCRIPT")
			objCmd.Run
			Set objCmd = Nothing
		End If
	End If

End Function

That didn't work. Same problem. Crashes.

Thanks for trying that, and sorry it didn't help.

We have a couple of things to look at in the code, but haven't been able to look in depth yet.

Any progress on this?

No. We'll update the thread when there's news.

We're thinking of adding some commands to let you do the same thing in a better way, but it will need to wait until we have time to implement them.

Any progress on this? Not pushing, just asking.

Changes in 12.5.1 may help, but only as a side effect. Adding the commands to allow a proper way to do what you were doing has not been done yet.