Bring a window to front

Hi! I would like toask anyone’s help if they can spare the time to this question:

  how do i make a certain window already opened to become the frontmost window always.

 i have tried this code but it is not working:
 set w to "Mydrive:Desktop:windname" as string
           
           tell application "Finder"
                  w to front
           end tell
  also this one:
tell window "windname"
            set frontmost to true
         end tell

both are not working. Hope you can help. Thank you.

This appears to work.

set w to "Mydrive:Desktop:windname"

tell application "Finder"
	if exists window of folder w then
		open window of folder w
	end if
end tell

– Rob