Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: ,

Sponsored Links



search for right file path if exist on Dos

Operating Systems


Reply
 
Thread Tools Search this Thread
  #1  
Old 26-06-2009
Member
 
Join Date: Apr 2009
Posts: 8
search for right file path if exist on Dos

Hello
On my DOS,I have a command ran from a file with arguments but bizarrely the drive path is likely wrong but the folder seems to be path is right.

but i doubt If it, because am i able to browse the drives for the right drive path, same time i can update it . I would just need to update c:\ to e:\ in the file


any thoughts??
Reply With Quote
  #2  
Old 26-06-2009
Solomon's Avatar
Member
 
Join Date: May 2008
Posts: 4,056
Re: search for right file path if exist on Dos

If you are not able to check for the existence of a directory, need to do check for a file within the directory... fortunately you can plug in the DOS constant NUL with the same results...

If exist c:\nul you would need to do to get your batch working is change the plain old r: to r:\nul

good luck...
Reply With Quote
  #3  
Old 26-06-2009
MrChris-'s Avatar
Member
 
Join Date: Apr 2008
Posts: 3,237
Re: search for right file path if exist on Dos

This xp batch file which I am trying to make work in 4dos
It gets a variable of a complete path of a file and then converts it
into only the path and then changes into that folder.
getpath.cmd
cd\
set path=z:\boot\xosl115\xosl\install.exe
FOR /F "TOKENS=*" %%G IN ("%path%") DO SET X=%%~dpG
echo %x%
cd/d %x%
pause
4DOS is a super set of COMMAND.COM, 4NT/TCC is a superset of CMD.EXE. the syntax is CMD.

cdd %@path[%@full[filename]]

enojy...
Reply With Quote
  #4  
Old 26-06-2009
Dr. V
 
Posts: n/a
Re: search for right file path if exist on Dos

Windows Vista you copy a file or folder's path to the Clipboard. hold down the Shift key and right-click a file or folder in Explorer"Copy as Path" when you see the option. Select it and the complete file path will be in the Clipboard, ready for pasting virtually anywhere. The path allows you to paste on a DOS command box...
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "search for right file path if exist on Dos"
Thread Thread Starter Forum Replies Last Post
The update file does not exist in AVG 2011 Tabita Networking & Security 4 19-02-2011 01:48 PM
Dead Space 2 Error file (.htm) does not exist ProfilerJI Video Games 4 03-02-2011 07:41 PM
Error : the specified path does not exist chaosblade Operating Systems 5 05-01-2011 11:01 PM
Visio 2003: shape search = Indexing Service Catalog does not exist Nigeltec MS Office Support 3 03-12-2007 05:19 AM
The File or Folder Does Not Exist 4472 Vista Help 7 21-07-2007 02:30 PM


All times are GMT +5.5. The time now is 02:31 AM.