Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:同样vbs代码 为什么独立就能运行 在金字塔里面就运行不了

1楼
mosler2500 发表于:2017/3/21 13:43:33
Function FilesTree(sPath)    
'遍历一个文件夹下的所有文件夹文件夹    
    Set oFso = CreateObject("Scripting.FileSystemObject")    
    Set oFolder = oFso.GetFolder(sPath)    
    Set oSubFolders = oFolder.SubFolders    
        
    Set oFiles = oFolder.Files    
    For Each oFile In oFiles    
        WScript.Echo oFile.Path    
        'oFile.Delete    
    Next    
        
    For Each oSubFolder In oSubFolders    
        WScript.Echo oSubFolder.Path    
        'oSubFolder.Delete    
        FilesTree(oSubFolder.Path)'递归    
    Next    
        
    Set oFolder = Nothing    
    Set oSubFolders = Nothing    
    Set oFso = Nothing    
End Function    
    
FilesTree("F:\hangyedaimashiyan") '遍历   
2楼
王锋 发表于:2017/3/21 14:40:14

WScript 不是金字塔支持的对象。

金字塔的VBS引擎中,可用的对象请参考 帮助菜单 -》VBA编程信息

3楼
mosler2500 发表于:2017/3/21 14:52:06
ok

共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.02441 s, 2 queries.