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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Terminal environment batch file with Explorer.exe

Status
Not open for further replies.

sirwolf

IS-IT--Management
Jan 4, 2006
3
CA
First of all Hi. I found this forum and it seems to be great. I will try to participate and help.

here is my question.
I use an environment for TS user. It calls a batch file.
Here it is.

--------
@echo off

net use P: /delete
net use T: /delete
net use U: /delete
net use R: /delete

net use P: \\caij-filesrv\public
net use T: \\caij-filesrv\transfert
net use u: \\caij-filesrv\%username%$
net use R: \\caij-filesrv\administration$

explorer

exit
------

The problem is after executing explorer.exe it will never execute the 'exit' command so the batch file window will stay there and the user need to click the X to close it. Anyone knows what should i do to close the batch file auto ?
 
ok sorry ..i found a simple way to make it work.

If you want to know .. here is the solution :

Just put a 'start' before calling EXPLORER.exe
----
@echo off

net use P: /delete
net use T: /delete
net use U: /delete
net use R: /delete

net use P: \\caij-filesrv\public
net use T: \\caij-filesrv\transfert
net use u: \\caij-filesrv\%username%$
net use R: \\caij-filesrv\administration$

start explorer

exit
------------
 
Glad you found your answer. Now I would suggest that you move away from batch scripting entirely. Time to update your toolbox and start using vbscript. faq329-5798

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top