Re: Using DOS batch file to change MSDE blank passwords

From: Jasper Smith (jasper_smith9_at_hotmail.com)
Date: 11/25/03


Date: Tue, 25 Nov 2003 19:42:57 -0000

If you want osql to quit after it has run your commands, use the -Q switch
e.g

osql -Usa -P -Q"Exec sp_password NULL,'Test!01','sa'" -n

(the -n stops the anoying numbers)

-- 
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"F_MIkey" <anonymous@discussions.microsoft.com> wrote in message
news:3F839990-5CD2-4CE8-AC28-7BEAF53EB99D@microsoft.com...
Hello.
I am attempting to write a batch file that will automatically logon and set
the blank passwords on multiple users laptops to a password of IS Supports
choosing.  My scripting skills are very raw but here is what I have thus
far:
osql -U sa -P
Exec sp_password NULL,'Test!01','sa'
go
exit
All I am able to accomplish is the following:
osql -U sa -P
1>
I don't want the users to have to do ANYTHING.  Can someone help me
accomplish this?


Relevant Pages

  • Re: Create Job to dump SP results into a text file.
    ... But its output is in a strange format. ... > As the first content you get, it is because the missing of some switches in> the OSQL utility, and the -L is an exclusive switch in osql utility, so you> get the content of 'The -L parameter can not used in combineation with> others parameters.' ... Could you connect the SQL Server via Query Analyzer by SQL Server> authentication using 'sa'? ...
    (microsoft.public.sqlserver.programming)
  • Re: Create Job to dump SP results into a text file.
    ... the OSQL utility, and the -L is an exclusive switch in osql utility, so you ... Could you connect the SQL Server via Query Analyzer by SQL Server ... To enable TCP/IP server network library by the Server Network Utility, ...
    (microsoft.public.sqlserver.programming)
  • Re: Can you use osql in DTS?
    ... Columnist, SQL Server Professional ... > osql. ... > DECLARE @curDate As DateTime ... > @chartime into a stored procedure that I would call. ...
    (microsoft.public.sqlserver.dts)
  • Re: Can you use osql in DTS?
    ... Columnist, SQL Server Professional ... > osql. ... > DECLARE @curDate As DateTime ... > @chartime into a stored procedure that I would call. ...
    (microsoft.public.sqlserver.programming)
  • Re: Sql Query
    ... osql won't connect to an AS/400, only SQL Server, AFAIK. ... registering cscript to be the default script host. ... Set oADO = CreateObject ...
    (microsoft.public.win2000.cmdprompt.admin)