I would like to find out how to stop / start MS SQL services so that I can copy SQL database files. I know how to do this manually but I would like to do this from a script.
Instead of copying the data files, what about taking a backup copy? That way you don't need to stop/start the SQL Server service and cause downtime, like this for example:
NET STOP MSSQLSERVER
NET START MSSQLSERVER
But i surgest if you want to copy the database files.. (I think for backup purposed).. you might consider using a maintenance plan with a backup schema if you already use MS SQL SERVER. For sql express you need some custom scripts. When the backup of your database is finished, the output file is not locked and you can store that one on a place you like for example a backup device.