Intelligent Automation & Macro Software  

Go Back   Tethys Solutions Forums > Products Zone > Automation Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Automation Anywhere Post messages and questions related to Automation Software here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2007, 06:01 PM
MacroJoe MacroJoe is offline
Junior Member
 
Join Date: Jun 2007
Posts: 1
Default %username%

I would like to add a variable that will give me the value of the user logged into the machine. %username% works in windows but how do I set this up as a variable in Automation Anywhere?
Thanks
Reply With Quote
  #2 (permalink)  
Old 06-25-2007, 10:18 AM
rlaliberte rlaliberte is offline
Junior Member
 
Join Date: Jun 2007
Posts: 17
Default

MacroJoe,

how are you determing the user name?
Reply With Quote
  #3 (permalink)  
Old 06-25-2007, 10:32 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 465
Default

Hello,

Yes, we do have a solution to get the name of the User logged on to a computer. For this we need to execute a command from DOS prompt (cmd.exe). We can use the following command to extract our desired result.

C:\>echo %username% > C:\UserName.txt

In this command the first part i.e. echo %username% will return the username logged in to the computer. Further in the second part of the command, > C:\UserName.txt, we redirect the output to a text file named UserName.txt in C drive; Henceforth we open the file UserName.txt from Automation Anywhere and copy the contents by using the Keystrokes command. So now your system variable $Clipboard$ consists the name of the user logged in to your computer.

I am sure this solution should work for you however if you have any questions please feel free to write back.

Your task would look as follows

1 Open "cmd.exe "
2 Keystrokes: echo %username% > C:\Username.txt[ENTER] in "Administrator: C:\Windows\System32\cmd.exe"
3 Open "C:\Username.txt "
4 Keystrokes: [CTRL DOWN]a[CTRL UP] in "Username - Notepad"
5 Keystrokes: [CTRL DOWN]c[CTRL UP] in "Username - Notepad"
6 Close Window: "Administrator: C:\Windows\System32\cmd.exe"
7 Close Window: "Username - Notepad"
8 Message Box: "$Clipboard$"

I am also uploading the atmn file.
Attached Files
File Type: atmn UserName.atmn (8.3 KB, 5 views)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 07:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2008 Tethys Solutions, LLC. All rights reserved