• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 721
  • Last Modified:

Using CALL command to execute remote BAT file

Within my local BAT file i have the following:

call "\\server\BatchLogin$\tflogin.bat" /user:domain1\user1 password
pause

However i get the error  "Logon Failure: unknown user name or bad password"

I know the user does have access to the file. Is there an error in my syntax?
0
Avatar261
Asked:
Avatar261
1 Solution
 
hoodlum_1978Commented:
I think that „/user:” parameter isn’t valid one for „call” command.
I think that first of all you should run “call” command by “runas” by context of user with have required permission on file server with is located on your network.
Regards,
0
 
d3ath5tarCommented:
You are passing two parameters....

where the /user switch and name are one param, password is another....

inside your bat you should have them assigned as $1 and $2 against the command you are passing....

of course it would help to see the command you are running inside the bat file :)
0
 
hoodlum_1978Commented:
Runas /user:domain1\user1 “call \\server\BatchLogin$\tflogin.bat” should work.
But in this scenario you have to provide password manually
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
d3ath5tarCommented:
Avatar, Just for clarity, is BatchLogin$ is secured and you are trying to authenticate to it from another batch file to run tflogin? Or is the BatchLogin$ read only for all and you are trying to pass a username and password into the batch file?
0
 
Avatar261Author Commented:
I think i figured it out. Thanks for all your comments.

The command actually works fine. After relogging it it just worked.

I was then receiving a 1219 error as the tflogin.bat file was mapping drives with the same authentication. When i removed the authentication from that file it all works fine.

I gather because you authenticate via the first bat file it isn't needed in the second unless you want to use a completely different user.

Do you think points should be assigned or is it an answer i have figured?
0
 
subhashchyCommented:
0
 
Russell_VenableCommented:
If it was I. I would give hoodlum_1978 some points as he did point out that the user parameter was incorrect as your first solution. No one asked what was in the batch file so no one knew you where authenticating twice. You can also select your comment as a solution and split the points with him.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now