Britbadboy Posted February 14, 2006 Share Posted February 14, 2006 hi,i want to put in a script that gets the following user info:the datethe time when the script is runthe user id of the user whos currently logged onand the operating system on that machinealso want to extract this info and save it as a txt or a log file on the specified drive on the machineplease will someone let me know if this is possinble, if so how do i go about it.many thanks. Link to comment Share on other sites More sharing options...
cdkid Posted February 14, 2006 Share Posted February 14, 2006 (edited) mmm look at the macros in the help file...straight from the help file@UserName | ID of the currently logged on user.@MON | Current month. Range is 01 to 12@YEAR | Current four-digit year @WDAY | Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday. @OSVersion | Returns one of the following: "WIN_2003", "WIN_XP", "WIN_2000", "WIN_NT4", "WIN_ME", "WIN_98", "WIN_95" and "WIN_6.0", "WIN_6.1" that will change with the official release...the help file is your best friend! know it well.~cdkid***edit***as for writing it to a file look in the helpfile atFileOpen | FileClose | FileWriteLine Edited February 14, 2006 by cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Britbadboy Posted February 14, 2006 Author Share Posted February 14, 2006 mmm look at the macros in the help file......the help file is your best friend! know it well.~cdkid***edit***as for writing it to a file look in the helpfile atFileOpen | FileClose | FileWriteLineyes i have looked at the macros the problem is i dont know how to use them... please help Link to comment Share on other sites More sharing options...
Britbadboy Posted February 14, 2006 Author Share Posted February 14, 2006 any help on how to use MACROS please?? Link to comment Share on other sites More sharing options...
Sokko Posted February 14, 2006 Share Posted February 14, 2006 Macros act exactly like variables, only you can't change them. This: MsgBox(0,"User Name",@UserName) ...will create a message box showing the name of the currently logged-on user. Link to comment Share on other sites More sharing options...
Britbadboy Posted February 14, 2006 Author Share Posted February 14, 2006 Macros act exactly like variables, only you can't change them. This:MsgBox(0,"User Name",@UserName)...will create a message box showing the name of the currently logged-on user.now this is wiked.... so wot do i have to do in order to get the put them into a txt file? this one creates a msgbox whereas i want all this info to go into a txt file and saved on the HD. Link to comment Share on other sites More sharing options...
CyberSlug Posted February 14, 2006 Share Posted February 14, 2006 so wot do i have to do in order to get the put them into a txt file?See the FileWriteLine example in the help file.... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Infinitex0 Posted February 14, 2006 Share Posted February 14, 2006 (edited) Think you need something like this. $file = FileOpen("C:\Documents and Settings\All Users\My Documents\log.txt", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "Day Of Year: " & @YDAY) FileWriteLine($file, "Day Of Week: " & @WDAY) FileWriteLine($file, "Year: " & @YEAR) FileWriteLine($file, "Month: " & @MON) FileWriteLine($file, "Day Of Month: " & @MDAY) FileWriteLine($file, "Hour: " & @HOUR) FileWriteLine($file, "Minute: " & @Min) FileWriteLine($file, "Second: " & @SEC) FileWriteLine($file, "User: " & @UserName) FileWriteLine($file, "Operating System: " & @OSVersion) FileWriteLine($file, "===============Seperate===============") FileClose($file) Just make a folder labeled log.txt and put it in all users I guess or whtever, just make sure that the address in the script fits also put this in your startup folder. Just Fix the address in the script to fit your needs Edited February 14, 2006 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now