PC Review


Reply
Thread Tools Rate Thread

Command Prompt Question

 
 
cu
Guest
Posts: n/a
 
      6th Feb 2007
Hi I am trying to write a simple batch file that opens a command
prompt under my domain username, then maps a network drive. I can do
this fine. The thing is that I would also like to change to this new
drive but can't figure out how to execute this command in the new
command prompt window that opens. The line of code is as follows.

runas /user:domain\username "cmd /k net use x: \\server\share"

I would like to add "x:" to the batch file. Any help would be great.
Thanks

 
Reply With Quote
 
 
 
 
Ayush
Guest
Posts: n/a
 
      6th Feb 2007
Replied to [cu]s message :
> Hi I am trying to write a simple batch file that opens a command
> prompt under my domain username, then maps a network drive. I can do
> this fine. The thing is that I would also like to change to this new
> drive but can't figure out how to execute this command in the new
> command prompt window that opens. The line of code is as follows.
>
> runas /user:domain\username "cmd /k net use x: \\server\share"
>
> I would like to add "x:" to the batch file. Any help would be great.
> Thanks
>



cd /d x:\

Good Luck, Ayush.
--
XP-Tips [Schedule a weekly defragmentation] :
http://www.microsoft.com/windowsxp/u...ps/defrag.mspx
 
Reply With Quote
 
cu
Guest
Posts: n/a
 
      6th Feb 2007


> cd /d x:\
>
> Good Luck, Ayush.
> --



This is all in a batch file so I cant simply add another line that
says x: or cd /d x:\. The batch file executes this command in the
original cmd prompt window not the one that opens up after i perform
the runas command. It seems that i would need the x: command to be
contained within the quotations but can't figure out how.

 
Reply With Quote
 
3c273
Guest
Posts: n/a
 
      6th Feb 2007
Not tested. Create a batchfile (c:\myfile.bat) with the following to lines:.
net use x: \\server\share
cd /d x:\
then issue this command:
cmd /k c:\myfile.bat.
Like I said, I didn't test it but it should work.
Louis


"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:(E-Mail Removed)...
> Replied to [cu]s message :
> > Hi I am trying to write a simple batch file that opens a command
> > prompt under my domain username, then maps a network drive. I can do
> > this fine. The thing is that I would also like to change to this new
> > drive but can't figure out how to execute this command in the new
> > command prompt window that opens. The line of code is as follows.
> >
> > runas /user:domain\username "cmd /k net use x: \\server\share"
> >
> > I would like to add "x:" to the batch file. Any help would be great.
> > Thanks
> >

>
>
> cd /d x:\
>
> Good Luck, Ayush.
> --
> XP-Tips [Schedule a weekly defragmentation] :
> http://www.microsoft.com/windowsxp/u...ps/defrag.mspx



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about command prompt =?Utf-8?B?bGVvbGl2ZXI=?= Windows XP Performance 1 22nd Oct 2007 03:41 PM
Command prompt question Jacky Luk Windows XP General 3 6th Aug 2006 03:20 PM
Command Prompt Question Jim Microsoft Windows 2000 CMD Promt 4 4th Jul 2006 07:04 PM
question about using the command prompt John Salerno Microsoft C# .NET 4 11th Mar 2005 06:02 AM
Command Prompt Question redseadiver Windows XP Help 2 25th Aug 2004 01:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 PM.