Like us on Facebook

Showing posts with label FileSystemObject. Show all posts
Showing posts with label FileSystemObject. Show all posts

February 8, 2015

FileSystemObject(UFT/QTP):Access File through VB Script

February 8, 2015

'##################################################################
'Working with Files through FileSystemObject in VB Script  for QTP/UFT
'Author: Vikas
'##################################################################
'1.Working with Files in VB Script

'1.1 How to create a text file  in QTP/UFTusing VB Script(Visual Basic Script) ?

Dim objFso,objFile
Set objFso=CreateObject("Scripting.FileSystemObject")' Fso object can be used to 
operate over both Files and Folder
'CreateTextFile method of File object creates a new  text file ,other parameter "True"
 is used to overwrite the exisitng file having same name
Set objFile=objFso.CreateTextFile( "D:\Music\myTextFile.txt",true)
'Output :

February 7, 2015

Access Folder/Dir in FileSystemObject in VB Script for UFT/QTP

February 7, 2015
'####################################################################
'Working with FileSystemObject in VB Script for QTP/UFT
'Author: Vikas
'####################################################################
'1.Working with Folder/Directory

'1.1 How to Create a New Folder in QTP/UFT using VB Script(Visual Basic Script) ?

Dim objFso,objFolder
Set objFso=CreateObject("Scripting.FileSystemObject")
'this CreateFolder method shall create a new folder  if  it does not exists 'in "D:\Music" Drive
' else it will throw an error
Set objFolder=objFso.CreateFolder("D:\Music\New Folder1")

.
© 2014-2015 Informational Digit : How-To & Tech Guides. The content is copyrighted to Vikas Pandey and may not be reproduced on other websites. WP themonic converted by Bloggertheme9.
TOP