+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
Windows Thread, Long File and Folder Names in Technical; Originally Posted by Arthur Btw, sorry for bumping an old thread but I thought it might be useful. It is ...
  1. #16

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    Quote Originally Posted by Arthur View Post
    Btw, sorry for bumping an old thread but I thought it might be useful.
    It is useful - learning new stuff is always good and I'd never noticed that log parser can query a file system!

  2. #17

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,680
    Thank Post
    3,210
    Thanked 1,030 Times in 955 Posts
    Rep Power
    361
    Quote Originally Posted by srochford View Post
    Sorry; that's normally what causes the problem but you can test for the filename length (rather than full path) by checking the length of "filename" rather than "name" - code below. The echo statement shows the full path - you might need to know where the problem file is :-)

    Code:
    sComputer="."
    Set oWMIService = GetObject("winmgmts:\\" & sComputer & "\root\cimv2")
    set colItems = oWMIService.ExecQuery("select * from CIM_Datafile where drive='C:'")
    for each item in ColItems
      if len(item.filename)>6 then
        wscript.echo item.name, item.FileName
      end if
    next
    Could you not do something like this where you have a variable and an inputbox and get it to prompt for how long you want the path for and where drive='C:'" etc use the vbscript browse folder option

    VBScript Scripting Techniques: Browse Folder Dialog

    That way you don't have to keep changing the Drive='C:'" etc it will just prompt for length and give you a browse window to browse and select where you want to scan

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Copy file across variable folder name
    By SimpleSi in forum *nix
    Replies: 11
    Last Post: 10th March 2009, 06:15 PM
  2. Exporting File names from a disc.
    By Neville in forum Windows
    Replies: 2
    Last Post: 25th February 2009, 12:58 PM
  3. Robocopy & long file names
    By cheryl in forum Windows
    Replies: 2
    Last Post: 18th January 2008, 10:27 PM
  4. Student Folder File permissions
    By CM786 in forum Wireless Networks
    Replies: 4
    Last Post: 27th September 2007, 09:28 AM
  5. VBS File takes long time to load 1st time?
    By Samson in forum Scripts
    Replies: 3
    Last Post: 4th September 2007, 07:40 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •