The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
change 43% to 43.5 nortypig Shell Programming and Scripting 2 08-20-2006 03:55 AM
IP change kuultak UNIX for Dummies Questions & Answers 2 07-13-2005 09:01 AM
UID Change mcateriny AIX 4 10-06-2003 12:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-18-2008
Jamil Qadir Jamil Qadir is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 13
how I change dir in dos

Hi

I have a dos batch file in window server where I call a cmd command for creating some db.
this cmd commad is located in e:\data\abcd\xyz.cmd.

Now I call this batch file from unix ssh.sh but my access point is D in window server here I want to change the dos prompt to e:\data\abcd.
in xyz.bat.

here is my batch file

regards

JAmil

SETLOCAL


set DateStr=%~2&if "%~2"=="" set DateStr=%date%
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('"echo.|date"') do (
for /f "tokens=1-3 delims=/.- " %%A in ("%DateStr:* =%") do (
set %%a=%%A&set %%b=%%B&set %%c=%%C))
rem set /a "yy=10000%yy% %%10000,mm=100%mm% %% 100,dd=100%dd% %% 100"


set filename=%yy%%mm% %dd%
echo.%filename%

Cd E:
cd \data
cd E:\data\local-ch-da

E:\data\local-ch-da\start_local-CH-DA_cablecom.cmd %yy%%mm% %dd%



endlocal
  #2 (permalink)  
Old 03-18-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
DOS does not think of C: D: etc as directories. They are "drives". To change drives you just do:
D:
So a pair of commands like:
D:
cd \data
might be needed.
  #3 (permalink)  
Old 03-18-2008
Jamil Qadir Jamil Qadir is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 13
you mean
i write just e: in dos bat file it change the directory.

from doller prompt i call a bat file
ssh user@connection e:\data\abc.bat
and in this batch I want to change the directory to e: because i get d: as default prompt.

abc.bat like this
e:
cd \data
start_xzy.cmd
  #4 (permalink)  
Old 03-18-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
Again, e: is a drive. e: is not a directory. To change your drive to e you need a line in your bat file that looks exactly like this:
e:
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes 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 On




All times are GMT -4. The time now is 11:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0