in a bat/cmd file or command prompt, you can get the computer name from the variable %computername%
so you can build a script with that...does that help?edit
also, if the script is alwasy being run on the same server, you don't need the computername anyway...you can just use the dot placeholder to reference the current server, i think
sqlcmd -S .\Inst -i C:\abc.sql
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!