Quality Testing

Quality is delighting customers

How to fetch the file / file name from local machine (Drive: C / D/ E / F)?

How to fetch the file / file name from local machine (Drive: C / D/ E / F) using QTP Tool?

Really appreciated your comments.

Regards,
Siva

Tags: (Drive:, /, C, D/, E, F)?, How, fetch, file, from, More…local, machine, name, the, to

Views: 8

Reply to This

Replies to This Discussion

doc_loa=Datatable.Value("Filename",strActionName)
set obj = CreateObject("Scripting.FileSystemObject")
strFileName = obj.GetFileName(doc_loa)
strExt = obj.GetExtensionName(strFileName)


set obj = CreateObject("Scripting.FileSystemObject")
strFileName = obj.GetFileName(Datatable.Value("Filename",strActionName)) ''To Get the FileName
strExt = obj.GetExtensionName(strFileName)
strOnlyFileName =Replace(strFileName,"." + strExt, "" )
strprc=Datatable.Value("Processes",strActionName) & "-" & strOnlyFileName
Script to get the files names form local folders:
--------------------------------------------------------
Dim a,b,c,d,e

Set a=createobject("scripting.filesystemobject")
Set b=a.getfolder("e:\backup") '' search for folder in local drive
Set c=b.files '' if any fiels are there in folder then it ger the names
'' if we need to print the folder names in the fodler then we can use " SubFolder "

'' Set c=b.subfolders ---------> likt this

For each d in c
e=e&d.name&vbnewline '' vbnewline is for print the file name in diffreant lines
Next
msgbox e
Set FSO = CreateObject("Scripting.FileSystemObject")
DriveName = "C:\" ' This can be changed acoording to need
Set SourceFolder = FSO.GetFolder(DriveName)
Set SourceFiles = SourceFolder.Files
For Each F1 in SourceFiles
Msgbox F1.Name
Next

RSS

TTWT Magazine

Webinar

You Can


Call for Articles

Advertisement

Videos

  • Add Videos
  • View All

Badge

Loading…

© 2012   Created by Quality Testing.

Badges  |  Report an Issue  |  Terms of Service