Unfortunately, the Nikon D40 only has a USB interface, so USB commands are the only option.