These inexpensive little locks will secure a sliding window while it’s open, much like putting a nail in the sash keeps a double-hung window from opening far enough for someone to enter. Unlike a nail though, you can easily remove, replace, change their position, or even use them to keep the window shut.
Prime-Line extrudes these locks from aluminum and lines the middle of channel with vinyl inserts to protect the window track. The locks fit both wide and narrow tracks — just position the lock where you want it and tighten the thumbscrew.
Two of these locks can cost you as little as a buck, but unfortunately that’s without exorbitant shipping charges. You’re probably better off finding something like them locally.