|
flyinspace
银牌会员
    
积分 1206
发帖 517
注册 2007-3-25
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
Originally posted by notepad at 2007-4-30 01:01 PM:
用不了啊 `````
什么意思???
Originally posted by notepad at 2007-4-30 01:01 PM:
It doesn't work啊 `````
What does it mean???
|

知,不觉多。不知,乃求知 |
|
2007-5-1 02:15 |
|
|
lililulula
中级用户
  
积分 302
发帖 138
注册 2007-3-29
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
set "fdname"="%%i"
call :GetFdName %fdname%
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
我改了下,我让它显示当前所在目录文件夹名为何fdname无法传递到getfdname里?如果我直接让它传递%%i的话碰到有空格的文件会不完全显示,所以我要设置fdname传递给getfdname
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
set "fdname=%%i"
call :GetFdName "%fdname%"
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
I made a change. I want it to display the current directory folder name, but why can't fdname be passed to getfdname? If I directly pass %%i, it doesn't display completely when there are spaces in the file, so I need to set fdname to pass to getfdname
|
|
2007-5-1 04:37 |
|
|
lililulula
中级用户
  
积分 302
发帖 138
注册 2007-3-29
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
要5.1了 预祝大家节日快乐 顺便来的人帮我看看问题啊 谢谢了
It's almost May Day. Wish everyone a happy holiday. By the way, people who come here, help me take a look at the problem. Thanks.
|
|
2007-5-1 05:50 |
|
|
zhoushijay
高级用户
    Autowalk
积分 845
发帖 375
注册 2007-3-3
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
@echo off
for /f "delims=" %%i in ("c:\aa\bb\cc") do (
echo %%~nxi
)
pause
@echo off
for /f "delims=" %%i in ("c:\aa\bb\cc") do (
echo %%~nxi
)
pause
|
|
2007-5-1 05:57 |
|
|
flyinspace
银牌会员
    
积分 1206
发帖 517
注册 2007-3-25
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
Originally posted by zhoushijay at 2007-4-30 04:57 PM:
@echo off
for /f "delims=" %%i in ("c:\aa\bb\cc") do (
echo %%~nxi
)
pause
这个怪我先前没有考虑周到。在发贴的时候忘记写下来了。。。
使用了 for 的特殊参数。。
我们的要求是不使用 这些特殊参数。
Originally posted by zhoushijay at 2007-4-30 04:57 PM:
@echo off
for /f "delims=" %%i in ("c:\aa\bb\cc") do (
echo %%~nxi
)
pause
This is my fault for not thinking carefully enough earlier. I forgot to write it down when posting...
The special parameters of for are used...
Our requirement is not to use these special parameters.
|

知,不觉多。不知,乃求知 |
|
2007-5-1 06:10 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
|
2007-5-1 13:24 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
Set WshSHell = WScript.CreateObject("WScript.Shell")
FP="c:\aaa\bbb\ccc"
FPArr=split(FP,"\")
For i=1 To UBound(FPArr)
FPTest = FPArr(i)
Next
WshSHell.popup "最终目录:"&vbcrlf&FPTest
Set WshSHell = Nothing
WScript.Quit(0)
```
Set WshSHell = WScript.CreateObject("WScript.Shell")
FP="c:\aaa\bbb\ccc"
FPArr=split(FP,"\")
For i=1 To UBound(FPArr)
FPTest = FPArr(i)
Next
WshSHell.popup "Final directory: " & vbcrlf & FPTest
Set WshSHell = Nothing
WScript.Quit(0)
```
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-5-1 16:24 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
Set WshSHell = WScript.CreateObject("WScript.Shell")
FP="c:\aaa\bbb\ccc"
FPArr=Split(FP,"\")
For i=1 To UBound(FPArr)
FPTest = FPArr(i)
Next
WshSHell.popup "最终目录:"&vbcrlf&FPTest
Set WshSHell = Nothing
WScript.Quit(0)
MsgBox FPArr(UBound(FPArr))不可以么?
InstrRev()不行么?
FP = "c:\aaa\bbb\ccc"
FPArr = Split(FP, "\")
MsgBox FPArr(UBound(FPArr))
Pos=InstrRev(FP, "\")+1
MsgBox Mid(FP,Pos,(Len(FP) - InstrRev(FP, "\")))
Last edited by slore on 2007-5-1 at 03:56 AM ]
Set WshSHell = WScript.CreateObject("WScript.Shell")
FP="c:\aaa\bbb\ccc"
FPArr=Split(FP,"\")
For i=1 To UBound(FPArr)
FPTest = FPArr(i)
Next
WshSHell.popup "Final directory: "&vbcrlf&FPTest
Set WshSHell = Nothing
WScript.Quit(0)
MsgBox FPArr(UBound(FPArr)) isn't okay?
InstrRev() isn't okay?
FP = "c:\aaa\bbb\ccc"
FPArr = Split(FP, "\")
MsgBox FPArr(UBound(FPArr))
Pos=InstrRev(FP, "\")+1
MsgBox Mid(FP,Pos,(Len(FP) - InstrRev(FP, "\")))
Last edited by slore on 2007-5-1 at 03:56 AM ]
|
|
2007-5-1 16:43 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
|
2007-5-1 17:04 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
|
2007-5-1 17:06 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
|
2007-5-1 17:40 |
|
|
zerocq
中级用户
  
积分 458
发帖 196
注册 2006-10-5
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
用vbs的split函数按/分割字符串
然后len函数逐个检测行不
Use the split function in VBS to split the string by "/" and then use the len function to check each line one by one
|
|
2007-5-1 18:10 |
|
|
lililulula
中级用户
  
积分 302
发帖 138
注册 2007-3-29
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
set "fdname"="%%i"
call :GetFdName %fdname%
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
我改了下,我让它显示当前所在目录文件夹名为何fdname无法传递到getfdname里?如果我直接让它传递%%i的话碰到有空格的文件会不完全显示,所以我要设置fdname传递给getfdname
5,1节前的问题,还是希望知道下原因,或者告诉我怎么解决含空格的文件名显示方法,如下例显示当前目录名时候如目录名含有空格则显示不完全.
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
call :GetFdName %%i
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
Last edited by lililulula on 2007-5-8 at 11:13 AM ]
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
set "fdname=%%i"
call :GetFdName %fdname%
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
I modified it. I want it to display the current directory folder name. Why can't fdname be passed to getfdname? If I directly pass %%i, when there are spaces in the file, it won't display completely. So I want to set fdname to pass to getfdname.
The problem before the May 1st holiday, still hope to know the reason, or tell me how to solve the method of displaying file names with spaces, as in the following example, when displaying the current directory name, if the directory name contains spaces, it will not display completely.
@echo off
for /f "tokens=* delims=" %%i in ('cd') do (
call :GetFdName %%i
)
:GetFdName
for /f "tokens=1,* delims=\" %%j in ("%~1") do (
if "%%k"=="" echo %%j&&pause&&goto :eof
call :GetFdName %%k
)
Last edited by lililulula on 2007-5-8 at 11:13 AM ]
|
|
2007-5-8 09:28 |
|
|
xtanbmy
初级用户
 
积分 47
发帖 31
注册 2008-3-17
状态 离线
|
『第 29 楼』:
为你的 努力 加油!!
使用 LLM 解释/回答一下
为你的 努力 加油!!
说实话,提一些有意义的问题,然后大家讨论解决,确实有助于提高论坛人气,也有助于一些新手快速成长起来!当然我自己也是新手,努力学习中...
为你的 努力 加油!!
Cheer up for your efforts!!
To be honest, raising some meaningful questions and then having everyone discuss and solve them indeed helps to increase the forum's popularity and also helps some newcomers to grow up quickly! Of course, I am also a newcomer, and I am studying hard...
Cheer up for your efforts!!
|
|
2008-4-7 16:40 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 30 楼』:
使用 LLM 解释/回答一下
似乎很久之前讨论过这个问题
It seems that this issue was discussed a long time ago
|
|
2008-4-8 05:38 |
|