append user/password to "cd \\..." possible?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
havanna
Member
Member
Posts: 163
Joined: 2003-02-27, 08:06 UTC
Location: Baden/Württemberg

append user/password to "cd \\..." possible?

Post by *havanna »

I'd like to use a button with cd... command for network acces to some dirs. Instead of entering user/password for this I'd like to send them as parameters (well, at least username).
Can this be done? how?

thx
User avatar
fmr
Junior Member
Junior Member
Posts: 6
Joined: 2003-08-14, 13:55 UTC
Contact:

Post by *fmr »

This seems to me like a great idea.

I'm sitting on a network with extremely slow access to shared disks (for some reason). I have to wait like 2 minutes before the username/pw dialog appears.

If I could have entered it all at once, TC could send this to the server when it asks for it, and I could be busy doing other stuff for that while.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can use the "net use" command which comes with Windows. Use net use /? for the parameters.
Author of Total Commander
https://www.ghisler.com
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

2ghisler(Author)

But you have to assign a drive letter ... :(
Would be great to pass admin /Password via TC-button.

Greetings,
Cheer up, Karl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2CADweazle
No, you don't need to assign a drive letter! Try e.g.
net use \\server\share
Author of Total Commander
https://www.ghisler.com
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

Fine!

But - when I try to make a batch file like this:

Code: Select all

net use \\server\c$ <passw> /user:administrator /persistant:no
cd \\server\c$
I always get the error: "UNC paths are not supported"

Entering "cd \\server\c$" in the TC-Command-line it works - it's not a trick, it's TC - or not?.

So again: What to enter in the TC-Button-Command-Line??

Greetings,
Cheer up, Karl
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

I always get the error: "UNC paths are not supported"
This is a lack on DOS prompt only.


If you manually select the server via "cd \\server" or select an according predefined entry of your directory hotlist (CTRL-D), you can select an entry (e.g. c$).
Select only ! not execute !

Now try a button like :

net use %P <passw> /user:administrator /persistant:yes

And you got access ...

Note the /persistant:yes means that it persists after the DOS prompt closes ...
#5767 Personal license
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

I always get the error: "UNC paths are not supported"
Under the registry path:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
create DWORD value DisableUNCCheck and set it to 1.
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

Edited: thanx to all above - my answer-box was open too long...

Found it "myself" (thanx go to norfie !!)

Create a server.bat and refer to it in the button-command-line.

Code: Select all

@echo off
net use \\server\c$ <passw> /user:administrator
%commander_path%\totalcmd.exe /o /r=\\server\c$
(Type %commander_path% only if you already use it.)

That's all folks.
'Bit annoying DOS-box... any suggestions appreciated!

Greetings,
Cheer up, Karl
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

Bit annoying DOS-box... any suggestions appreciated!
You can execute "net use" command only once during logon to Windows and assign "cd \\server\share" command to TC button.
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

2VadiMGP

??
Works fine for me (Maybe 'cause I use win2000?)
Cheer up, Karl
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

Of course, it works.
But if i understand you don't want to see DOS-box, right? If i mistake forget about my post.
I just suggested way to eliminate DOS-box. To get access to shared folder it is not necessary to execute "net use" command every time. So i suggested to execute it once during Windows logon procedure. Now, you don't have to create server.bat file and run totalcmd again. The "cd \\server\share" command can be executed by TC as regular command.
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

2VadiMGP

Ahaaa, now I got you! Misunderstood your "...can...only once...". :roll:
Your solution is fine indeed for 2-3 server.

I have to get access to 5-10 servers - sometimes.
The startup-delay isn't worth for this.

Anyway - good idea, I'll keep it in mind - thank you. :)

Greetings,
Cheer up, Karl
Post Reply