/build/static/layout/Breadcrumb_cap_w.png

Place username in text file - Help Req

I am looking to place the current logged on username into a text file on the local machine. How is the best way to do this?

I am using Wise and I took a look at the WiseScript editor and it appears that I would use the 'Insert line into text file' action but I am not sure how I go about reading in the current userid.

Also, I am difficulties getting Wisescript editor to create an exe so that I can test it....It doesnt seem to compile

Thanks

Aidan

0 Comments   [ + ] Show comments

Answers (4)

Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
I would probably use VBScript, but if you are going to use Wise then the value to get the currently logged on user would be [LogonUser].

Good luck.
Posted by: Bladerun 18 years ago
Green Belt
0
In Wisescript, you can also use the Get Registry Key Value. The last logged on user is recorded in the registry in DefaultUserName value in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.

Insert that into your text file.
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
If the format of the text file doesn't matter, you could even use the "IniFile" table. Then you wouldn't even need a custom action, and the file doesn't even have to have an ".ini" exension. Maybe something like this?


[UserNames]
[%UserName]=[Date]@[Time]
Posted by: PowerCat 18 years ago
Senior Yellow Belt
0
Hello. Here is how you can do it with a batch file.

echo %username% > c:\username.txt

If you need other things in the text file, you can easily do this:

echo [Someheader] >> c:\username.txt
echo %username% >> c:\username.txt
echo [Somefooter] >> c:\username.txt


The difference between > and >> is that double greater than signs will append the file, rather than replace it.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ