View previous topic :: View next topic |
Author |
Message |
dmonckton Contributor
Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Mon Sep 05, 2011 2:33 pm Post subject: USERNAME environmental variable problem |
|
|
Hi All
I have this feeback subroutine to report from all the machines in our network. %%feedbackFolder is a common folder visable by all machines. The routine runs locally on each machine with administrator rights.
Code: |
:feedBack
list create,28
list add,28,@datetime(ddd ddddd tam/pm)
list add,28,@chr(32)
list add,28,%1
list savefile,28,%%feedbackFolder\@env(USERNAME)"--"@env(COMPUTERNAME).txt
%x = @ok()
wait
list close,28
if @null(%x)
exit
end
exit 1 |
The @env(USERNAME) function is not returning anything in Windows 7 but works fine in XP. The text files are being created by Win7 but are missing the user's name. Does anyone know why?
Thanks
David.M |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Mon Sep 05, 2011 3:12 pm Post subject: |
|
|
Your routine works on my Win7 x64 Ent. with both normal user and when run as admin. Are running your app as a service?
Code: | %%feedbackFolder = C:\temp
:feedBack
list create,28
list add,28,@datetime(ddd ddddd tam/pm)
list add,28,@chr(32)
list add,28,%1
list savefile,28,%%feedbackFolder\@env(USERNAME)"--"@env(COMPUTERNAME).txt
%x = @ok()
wait
list close,28
if @null(%x)
exit
end
exit 1 |
|
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Sep 05, 2011 4:32 pm Post subject: |
|
|
Works on my Windows 7 32 bit Professional. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon Sep 05, 2011 6:03 pm Post subject: |
|
|
Work on my Windows 7 Ultimate 32bit |
|
Back to top |
|
|
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Mon Sep 05, 2011 6:47 pm Post subject: |
|
|
Works on x64 windows 7 ult |
|
Back to top |
|
|
dmonckton Contributor
Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Tue Sep 06, 2011 8:10 am Post subject: |
|
|
Thanks for testing the routine everyone. The problem must be with McAfee A.V. or Privilege Guard which is our rights control s/w. I don't run this as a service, it runs from the All Users Startup folder. I'm going to uninstall McAfee from one of the problem machines and see what happens.
Thanks for all your help
David.M |
|
Back to top |
|
|
|