How can i open a folder and read/write into a text file which is protected by Username and Password?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can i open a folder and read/write into a text file which is protected by Username and Password?
Hi Team,
Let us assume
Path : C:\app\Modifying\Automation
Folder Name : Automation
Text file Name : abc.txt
I want to open a text file(abc.txt) which is available in the folder Automation. But the folder is password protected.
i.e when i am trying to open Automation folder manually by double clicking, A popup will appear and i need to enter username and password.
Using script, How can i open a folder and read/write into a text file which is protected by Username and Password.
Thanks in Advance,
BommaReddy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Hm-m-m... Anything that prevents you from providing proper credentials into the dialog?
Have you tried to record your actions with TestComplete and check the result of the recording?
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens when try to use aqFile.OpenTextFile(<filePath>,11,20)?
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Shankar,
When i tried to open using syntax OpenTextFile(<filePath>,11,20), I am getting error as "Unable to open the file."
Regards,
BommaReddy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is expected result.
Where your file located,
Is it network drive? If it is network drive then you can do some stuffs available https://www.codeproject.com/Questions/265459/HOW-TO-ACCESS-A-SHARED-FOLDER-VIA-COMMAND-LINE
Or Folder locked with some other folder locker tool? You have find out whether that locker tool have any command line options to unlock your folder.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So how can I establish a connection from script to read and write in a text file which is located in FTP?
Regards,
BommaReddy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have not worked with those stuffs but i guess you can use below line to connect the network drive
net use "\\NETWORKPATH\DRIVENAME" /user:"ROUTERNAME" "PW"
But I'm not sure how it is going to help you 😞
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> The file is located in FTP
This thread might help: https://community.smartbear.com/t5/TestComplete-General-Discussions/Uploading-file-to-an-FTP-server/...
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@bommareddy wrote:
The file is located in FTP(File transfer protocol).
So how can I establish a connection from script to read and write in a text file which is located in FTP?
You'll need to download the file from FTP to the local computer, then read/write the file (e.g. using the aqFile object), then upload the file back to FTP.
There are several ways to work with FTP:
- Some customers use the free WinSCP tool. It has a command-line interface), a COM object, and a .NET assembly (can be called via CLR Bridge).
- Windows also has the built-in ftp command-line tool. Check the example here: https://tinyapps.org/docs/ftp.html
- .NET class System.Net.FtpWebRequest can be used via CLR Bridge.
- COM object ChilkatFTP (free). Check the example here: http://www.robvanderwoude.com/vbstech_internet_ftp.php
Hope this helps!
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
