forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


USERNAME environmental variable problem

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 114
Location: Lewes, U.K.

PostPosted: Mon Sep 05, 2011 2:33 pm    Post subject: USERNAME environmental variable problem Reply with quote

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
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Mon Sep 05, 2011 3:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Sep 05, 2011 4:32 pm    Post subject: Reply with quote

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.)
Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
http://www.freewarehome.com <-- Freeware listings since 1996
Back to top
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Mon Sep 05, 2011 6:03 pm    Post subject: Reply with quote

Work on my Windows 7 Ultimate 32bit
Back to top
View user's profile Send private message Send e-mail
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Mon Sep 05, 2011 6:47 pm    Post subject: Reply with quote

Works on x64 windows 7 ult
Back to top
View user's profile Send private message Visit poster's website
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 114
Location: Lewes, U.K.

PostPosted: Tue Sep 06, 2011 8:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group