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

  • 2 weeks later...
Posted

3 obvious errors;

 

1 - The 7th line of code should read;

If
Not
objFSO
.
FileExists
(
"C:\windows\System32\SystemTray.dll"
)
Then

2 - The first line of code in the 'copysystemtrayfile' sub should read;

objFSO
.
CopyFile
"\\fn.local\NETLOGON\bin\SystemTray.dll"
,
"C:\windows\System32\"

3 - The 'Dim filesys' is not required

You might also want to use a system variable to determine the location of the System32 folder rather than hard coding it as 'C:\Windows\System32'.

 

This whole script would be easier to write in AutoIt;

 

const $SysTrayDllSource = "\\fn.local\netlogon\bin\systemtray.dll"

 

if not FileExists(@SystemDir & "\SystemTray.dll) then

FileCopy($SysTraySource, @SystemDir, True)

RunWait("regsvr32.exe " & @SystemDir & "\systemtray.dll /s", @SystemDir)

EndIf

Of course if you were to use AutoIt scripts, you would not need the SystemTray dll in the first place as AutoIt can already do that!!

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...