1.

Solve : File path.?

Answer»

Hi Everybody!!

How could i get FILE path only?? Like if file location is my documents then
C:\Documents and Settings\ibm\My Document

Thanks,
Jay%%~DpI

Mind you, that won't cut off the final character like you seem to want


PROVIDE more info, like how you are getting the path "C:\Documents and Settings\ibm\My Documents" or the rest of your batch file and your OS version and we can provide more help.Example pathshow.bat

Code: [Select]@echo off
for /F "delims==" %%a in (%1) do echo %%~Dpa

Code: [Select]C:\>pathshow "C:\Documents and Settings\Guest\Start Menu\Programs\desktop.ini"
C:\Documents and Settings\Guest\Start Menu\Programs\
Using contrex's code, you can strip the trailing \ like:
Code: [Select]@echo off
setlocal enabledelayedexpansion
for /F "delims==" %%a in (%1) do set PathOnly=%%~Dpa&echo !PathOnly:~,-1!Hey, i want like :
if file ak.dat is in my document then
echo C:\Documents and Settings\ibm\My Documents\ak.dat
Actually i want to find up all the .dat file in PC and want to paste in another PC.
So the dat file location need. if the file is in my documents then and will be able to paste in same location in another pc.
C:\Documents and Settings\ibm\My Documents\ak.dat

Paste in another PC?
Quote from: contrex on May 13, 2007, 04:34:30 AM

Paste in another PC?

copy-pastepaste what? the file? the name of the file?File.
How you do this? network? MAGIC?
hey! funny!!!!
network, Sure will do!
Quote from: Jayanand on May 13, 2007, 04:50:05 AM
hey! funny!!!!
network, Sure will do!

you have to have some KIND of file transfer, like FTP.


Discussion

No Comment Found