Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEt Use Batch File

Status
Not open for further replies.

gtjr92

Programmer
May 26, 2004
96
I have a scheduled job that runs a query and spools the sql file to a folder on another server. They are getting a new server that they want me to spool this file too, and moving it to a different domain than what my server is on.
I have a user name for that domain for the purposes of this forum I will call it newdomain.
I am sure this is easy but i am having a brain cramp.
How can i tell the bat file to use my other domains username and password. I know you can tell net use a password, but from my understanding that is only if the share itself is password protected.

I use scheduled tasks to run this job, and if i try to put my newdomain user name in password in the job it just comes back and says it could not verify my username and password.
Here is my bat file. Of course I changed all my information
[highlight]net use z:\\123.456.789.\folder_in\ /user:newdomain\username
''next line is line to run sql file
sqlplus sqlusername@testplus/TEST@d:\download\filename.sql [/highlight]
thanks for the help
 
Are your passwords and user name the same on each domain?

I hope you find this post helpful.

Regards,

Mark
 
No different username & different password
 
Sorry for the late follow up. Is this still an issue?

I would recommend synching user name and password between the domains. You could alternatively look at adding a trust between the domains and have your user ID given rights to the destination directory that way.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top