admin管理员组文章数量:1418661
The problem: My test VBScript (Windows Platform) to obtain filenames return the name of file, all in lowercases!
I would like keep the real cases of the filenames. Anyone cant help me?
The WMI script:
requete = "Select * from CIM_DataFile Where Drive = 'M:' and Path ='\\Cabinet\\Test\\'"
set colFiles = objWMIService.ExecQuery (requete)
For Each objFile in colFiles
Wscript.Echo objFile.FileName& "." & objFile.Extension
Next
After the latest comment I'm following... to specify.
I didn't talk about an environment variable problem.
Here you are the file list under my path :
2024-12-03_EMC Avis de prélèvement 2025.pdf
2024-12-03_ONPP Appel à Cotisations 2025.pdf
2025-01-01_Loyer Peyrollerie Janvier.pdf
Here you are with the WMI Script (bellow) :
2024-12-03_emc avis de prélèvement 2025
2024-12-03_onpp appel à cotisations 2025
2025-01-01_loyer peyrollerie janvier
The case is lost and I want the right case. That's the problem and I don't know why. Moreover with the WMI I can make request with, for example : "and FileName like '%IRCANTEC%'""
but not with FSO object. Is it more clear ?
Here you are with FSO :
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("M:\Cabinet\Test\")
For Each oFile In oFolder.Files
WScript.Echo oFile.Name
nomFichier = oFile.Name
Next
2024-12-03_EMC Avis de prélèvement 2025.pdf
2024-12-03_ONPP Appel à Cotisations 2025.pdf
2025-01-01_Loyer Peyrollerie Janvier.pdf
!!!!
Thanks a lot !
本文标签: vbscriptWMI queries to the CIMDataFile class and the case of file nameStack Overflow
版权声明:本文标题:vbscript - WMI queries to the CIM_DataFile class and the case of file name? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745292309a2651870.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论