preload

How to find last modified file (TestComplete, QTP, ...

Posted by Albert Gareev on Jul 26, 2011
3
Reference page: Service Functions – System (QTP, VBScript) Description  Check folder exists – check folder has files. Iterate through collection of files and keep reference of the most recently modified file (its DateLastModified property is always the highest number). The remaining reference is the one that you need. In case of errors the function returns […] ...

Checking structure of created folders (Excel/VBA)

Posted by Albert Gareev on May 05, 2010
1
In the previous post I warned about possible synchronization issues while copying a complex and/or large file-folder structure. To ensure reliability of the operation performed we may verify the structure that was created. We need to answer the following questions before designing the script. Which folders and files should it verify? Which way should it […] ...

Creating folder structure from a template (Excel/VBA)

Posted by Albert Gareev on May 03, 2010
0
How to create a complex folder structure by using a template In the previous post I provided code example that creates a folder and then applies security permissions on it. However, as per requirements, user folders often come with a predefined structure of folders and some files created by default. Sure, we can write script […] ...

SetACL command line automation examples

Posted by Albert Gareev on Apr 29, 2010
0
In this post  I provide code snippets for SetACL tool command line automation.  Examples of command line instructions were taken from here. The code presented below is written in VBA for MS Excel. CreateUserFolder function can create folders on a local or network drive. After user folder is created, the function sets typical access permissions by […] ...

Processing files contained in a folder

Posted by Albert Gareev on Mar 15, 2010
1
Reference page: Service Functions – System (QTP, VBScript) Question The question was asked here. I need to check number of text files in the folder but i dont know names Answer Checking what number of files is contained in a folder is simple. More challenging tasks would be processing files based on type or name […] ...

How to check if folder exists (QTP, VBScript)

Posted by Albert Gareev on Jan 24, 2010
1
Parent page: Service Functions – System (QTP, VBScript) Use FileSystemObject.FolderExists method. Argument should be a full path string.   When to use it? Always before trying to access the folder (delete, rename, or read from) or create files in it. Note. Always release the object you created when you no longer need it. If you don’t do […] ...

How to create a unique subfolder (QTP, VBScript)

Posted by Albert Gareev on Dec 16, 2009
1
Parent page: Service Functions – System (QTP, VBScript) How to create a unique subfolder Description A subfolder is created based on the name pattern and a date-time stamp, e.g. “AccountSearch 2009-10-14 17-18-03”.  You can add extra steps and form the code as a function that returns full path of the newly created subfolder. sName – name pattern sFullPath […] ...

How to duplicate an existing file (QTP, VBScript)

Posted by Albert Gareev on Dec 15, 2009
0
Parent page: Service Functions – System (QTP, VBScript) How to duplicate an existing file (If you want to access the file but it’s locked) Description sFileName – name of the file to duplicate sNewName – name of created file (generated automatically), pass-back argument. Uses UniqueFilename function to generate a name for the duplicate file. ...

How to generate unique file name (QTP, VBScript)

Posted by Albert Gareev on Dec 14, 2009
0
Parent page: Service Functions – System (QTP, VBScript) How to generate a unique file name if the file name already exists in the given folder (That often happens, if you need to create a series of files or duplicate an existing file) Description sFileName – the “original” file name or file name template sFolderName – parent folder […] ...

How to separate file name and path (QTP, VBScript)

Posted by Albert Gareev on Oct 25, 2009
3
Parent page: Service Functions – System (QTP, VBScript) Use FileSystemObject.GetFile method to obtain a File object. Argument should be a full path string. Set FSO = CreateObject(“Scripting.FileSystemObject”) Check if the file exists first. When to use it? There is a variety of utility tasks related to it: get parent folder, create another file in the same folder, create another […] ...

How to check if file exists (QTP, VBScript)

Posted by Albert Gareev on Oct 24, 2009
2
Parent page: Service Functions – System (QTP, VBScript) Use FileSystemObject.FileExists method. Argument should be a full path string.   When to use it? Always before trying to access the file (delete, rename, or read from).   Does file format matter? No. It could be text file, excel spreadsheet, bitmap, binary file, – anything. Just make sure you […] ...

Generate filename with a timestamp (WinRunner, TSL)

Posted by Albert Gareev on Feb 22, 2007
0
How to generate filename with a timestamp Parent page: Service Functions – System (WinRunner, TSL) ...

Service Functions – System (WinRunner, TSL)

Posted by Albert Gareev on Feb 21, 2007
0
In the code examples I present I often refer to routine functions. In my framework I have specialized libraries to call from.  In my blog I maintain the similar structure. Create Folder Copy File Delete File How to generate filename with a timestamp How to generate filename with a timestamp ...
Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.