Guest TimParker Posted August 25, 2008 Posted August 25, 2008 I have what I thought would be a simple project that is stumping me at the moment. I was asked to create a simple login/out file to log when a user signs in and out of a machine. I set up the script shown here: echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ \mopssrv01\MISData\MOPS-LOGONS.csv Simple one line bat file that I put in as a Login Script through GP. I have another one for Logout with just the word change at the end to tell me what they were doing. This is the output that I get in my CSV. Note the first and last one has the MON as part of the date. I have looked around and must be totally blind as I dont' see where I can change the actual format of the date to get two different values for %date%. Any ideas/thoughts? WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login WKSTN0014 USER2 08/25/2008 9:05:19.57 Login WKSTN0033 USER3 08/25/2008 9:05:21.96 Login WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut Not that it would really matter, but I did change the names from the real users! TIA. Tim
Guest Pegasus \(MVP\) Posted August 25, 2008 Posted August 25, 2008 Re: %date% returns different values for login script. "TimParker" <timpar@gmail.com> wrote in message news:2c3f341a-4af7-4284-b436-14f862fcc963@y38g2000hsy.googlegroups.com... >I have what I thought would be a simple project that is stumping me at > the moment. I was asked to create a simple login/out file to log when > a user signs in and out of a machine. I set up the script shown here: > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > \mopssrv01\MISData\MOPS-LOGONS.csv > > Simple one line bat file that I put in as a Login Script through GP. I > have another one for Logout with just the word change at the end to > tell me what they were doing. > > This is the output that I get in my CSV. Note the first and last one > has the MON as part of the date. I have looked around and must be > totally blind as I dont' see where I can change the actual format of > the date to get two different values for %date%. Any ideas/thoughts? > > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > > > Not that it would really matter, but I did change the names from the > real users! > > TIA. > Tim This happens when different users have different international settings in their profiles. You can resolve the issue in several ways. Here are two of them: - Use tool such as now.exe (Windows Technical Resource Kit). It displays the time always like so: Mon Aug 25 21:38:36 2008 - Use a vb script to format the date/time independently from any international settings. I think that this is a problem that should have been addressed by Microsoft a long, long time ago, e.g. by providing a couple of fixed-format environmental variables.
Guest TimParker Posted August 25, 2008 Posted August 25, 2008 Re: %date% returns different values for login script. Strange, I was thinking something along those lines, but when I look for where I might be able to change it, even if its me manually going around from workstation to wrokstation. I haven't figured out where the difference is at. .... On Aug 25, 3:42 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote: > "TimParker" <tim...@gmail.com> wrote in message > > news:2c3f341a-4af7-4284-b436-14f862fcc963@y38g2000hsy.googlegroups.com... > > > > > > >I have what I thought would be a simple project that is stumping me at > > the moment. I was asked to create a simple login/out file to log when > > a user signs in and out of a machine. I set up the script shown here: > > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > > \mopssrv01\MISData\MOPS-LOGONS.csv > > > Simple one line bat file that I put in as a Login Script through GP. I > > have another one for Logout with just the word change at the end to > > tell me what they were doing. > > > This is the output that I get in my CSV. Note the first and last one > > has the MON as part of the date. I have looked around and must be > > totally blind as I dont' see where I can change the actual format of > > the date to get two different values for %date%. Any ideas/thoughts? > > > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > > > Not that it would really matter, but I did change the names from the > > real users! > > > TIA. > > Tim > > This happens when different users have different international > settings in their profiles. You can resolve the issue in several > ways. Here are two of them: > - Use tool such as now.exe (Windows Technical Resource Kit). > It displays the time always like so: Mon Aug 25 21:38:36 2008 > - Use a vb script to format the date/time independently from any > international settings. > I think that this is a problem that should have been addressed by > Microsoft a long, long time ago, e.g. by providing a couple of > fixed-format environmental variables.- Hide quoted text - > > - Show quoted text -
Guest Pegasus \(MVP\) Posted August 25, 2008 Posted August 25, 2008 Re: %date% returns different values for login script. It's in the Control Panel / Regional Settings, and it's user-specific. "TimParker" <timpar@gmail.com> wrote in message news:c29917ac-2303-41d9-a4f0-06488ede87f5@m44g2000hsc.googlegroups.com... Strange, I was thinking something along those lines, but when I look for where I might be able to change it, even if its me manually going around from workstation to wrokstation. I haven't figured out where the difference is at. .... On Aug 25, 3:42 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote: > "TimParker" <tim...@gmail.com> wrote in message > > news:2c3f341a-4af7-4284-b436-14f862fcc963@y38g2000hsy.googlegroups.com... > > > > > > >I have what I thought would be a simple project that is stumping me at > > the moment. I was asked to create a simple login/out file to log when > > a user signs in and out of a machine. I set up the script shown here: > > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > > \mopssrv01\MISData\MOPS-LOGONS.csv > > > Simple one line bat file that I put in as a Login Script through GP. I > > have another one for Logout with just the word change at the end to > > tell me what they were doing. > > > This is the output that I get in my CSV. Note the first and last one > > has the MON as part of the date. I have looked around and must be > > totally blind as I dont' see where I can change the actual format of > > the date to get two different values for %date%. Any ideas/thoughts? > > > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > > > Not that it would really matter, but I did change the names from the > > real users! > > > TIA. > > Tim > > This happens when different users have different international > settings in their profiles. You can resolve the issue in several > ways. Here are two of them: > - Use tool such as now.exe (Windows Technical Resource Kit). > It displays the time always like so: Mon Aug 25 21:38:36 2008 > - Use a vb script to format the date/time independently from any > international settings. > I think that this is a problem that should have been addressed by > Microsoft a long, long time ago, e.g. by providing a couple of > fixed-format environmental variables.- Hide quoted text - > > - Show quoted text -
Guest TimParker Posted August 26, 2008 Posted August 26, 2008 Re: %date% returns different values for login script. Yeah, I found that applet but when I look at two WinXP SP2 machines that are reporting different values. The data looks the same. I had the user in question for the second machine logged on when I looked. I also had figured that it must be a user setting as I see two users (myself being one of them) logging into one of our terminal Servers and getting different values. What specifically do I need to change to make this work (ie: report the same value for %date%? On Aug 25, 4:33 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote: > It's in the Control Panel / Regional Settings, and it's user-specific. > > "TimParker" <tim...@gmail.com> wrote in message > > news:c29917ac-2303-41d9-a4f0-06488ede87f5@m44g2000hsc.googlegroups.com... > Strange, I was thinking something along those lines, but when I look > for where I might be able to change it, even if its me manually going > around from workstation to wrokstation. I haven't figured out where > the difference is at. .... > > On Aug 25, 3:42 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote: > > > > > "TimParker" <tim...@gmail.com> wrote in message > > >news:2c3f341a-4af7-4284-b436-14f862fcc963@y38g2000hsy.googlegroups.com.... > > > >I have what I thought would be a simple project that is stumping me at > > > the moment. I was asked to create a simple login/out file to log when > > > a user signs in and out of a machine. I set up the script shown here: > > > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > > > \mopssrv01\MISData\MOPS-LOGONS.csv > > > > Simple one line bat file that I put in as a Login Script through GP. I > > > have another one for Logout with just the word change at the end to > > > tell me what they were doing. > > > > This is the output that I get in my CSV. Note the first and last one > > > has the MON as part of the date. I have looked around and must be > > > totally blind as I dont' see where I can change the actual format of > > > the date to get two different values for %date%. Any ideas/thoughts? > > > > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > > > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > > > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > > > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > > > > Not that it would really matter, but I did change the names from the > > > real users! > > > > TIA. > > > Tim > > > This happens when different users have different international > > settings in their profiles. You can resolve the issue in several > > ways. Here are two of them: > > - Use tool such as now.exe (Windows Technical Resource Kit). > > It displays the time always like so: Mon Aug 25 21:38:36 2008 > > - Use a vb script to format the date/time independently from any > > international settings. > > I think that this is a problem that should have been addressed by > > Microsoft a long, long time ago, e.g. by providing a couple of > > fixed-format environmental variables.- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
Guest WORLDe Posted August 26, 2008 Posted August 26, 2008 Re: %date% returns different values for login script. where is a good site to go to to learn all about batch file commands...how to use them, create them, and outputs for them??? "TimParker" wrote: > Yeah, I found that applet but when I look at two WinXP SP2 machines > that are reporting different values. The data looks the same. I had > the user in question for the second machine logged on when I looked. I > also had figured that it must be a user setting as I see two users > (myself being one of them) logging into one of our terminal Servers > and getting different values. > > What specifically do I need to change to make this work (ie: report > the same value for %date%? > > > On Aug 25, 4:33 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote: > > It's in the Control Panel / Regional Settings, and it's user-specific. > > > > "TimParker" <tim...@gmail.com> wrote in message > > > > news:c29917ac-2303-41d9-a4f0-06488ede87f5@m44g2000hsc.googlegroups.com... > > Strange, I was thinking something along those lines, but when I look > > for where I might be able to change it, even if its me manually going > > around from workstation to wrokstation. I haven't figured out where > > the difference is at. .... > > > > On Aug 25, 3:42 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote: > > > > > > > > > "TimParker" <tim...@gmail.com> wrote in message > > > > >news:2c3f341a-4af7-4284-b436-14f862fcc963@y38g2000hsy.googlegroups.com.... > > > > > >I have what I thought would be a simple project that is stumping me at > > > > the moment. I was asked to create a simple login/out file to log when > > > > a user signs in and out of a machine. I set up the script shown here: > > > > > > echo %COMPUTERNAME%, %USERNAME%, %date%, %TIME%, Login >> \ > > > > \mopssrv01\MISData\MOPS-LOGONS.csv > > > > > > Simple one line bat file that I put in as a Login Script through GP. I > > > > have another one for Logout with just the word change at the end to > > > > tell me what they were doing. > > > > > > This is the output that I get in my CSV. Note the first and last one > > > > has the MON as part of the date. I have looked around and must be > > > > totally blind as I dont' see where I can change the actual format of > > > > the date to get two different values for %date%. Any ideas/thoughts? > > > > > > WKSTN0027 USER1 Mon 08/25/2008 9:04:02.45 Login > > > > WKSTN0014 USER2 08/25/2008 9:05:19.57 Login > > > > WKSTN0033 USER3 08/25/2008 9:05:21.96 Login > > > > WKSTN0021 USER4 Mon 08/25/2008 9:07:03.16 LogOut > > > > > > Not that it would really matter, but I did change the names from the > > > > real users! > > > > > > TIA. > > > > Tim > > > > > This happens when different users have different international > > > settings in their profiles. You can resolve the issue in several > > > ways. Here are two of them: > > > - Use tool such as now.exe (Windows Technical Resource Kit). > > > It displays the time always like so: Mon Aug 25 21:38:36 2008 > > > - Use a vb script to format the date/time independently from any > > > international settings. > > > I think that this is a problem that should have been addressed by > > > Microsoft a long, long time ago, e.g. by providing a couple of > > > fixed-format environmental variables.- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text - > >
Guest Pegasus \(MVP\) Posted August 26, 2008 Posted August 26, 2008 Re: %date% returns different values for login script. "WORLDe" <WORLDe@discussions.microsoft.com> wrote in message news:FC420297-A6BC-4D0C-B3C7-D1EBADBD5FDA@microsoft.com... > where is a good site to go to to learn all about batch file commands...how > to > use them, create them, and outputs for them??? Best to ask this question in alt.msdos.batch.nt - that's where the batch experts hang out.
Recommended Posts