Fellow computer geeks, I need your help.

General discussions not related to the Vibe, Matrix, or any other vehicle. (follow posting rules)
Post Reply
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Fellow computer geeks, I need your help.

Post by Mr. Poopypants »

I have a login script for a windows domain, I need to insert a command into the script that will only run the script on Wednesday.Is there a way to do this and what is the sytax?
A bartender is just a pharmacist with a limited inventory.
User avatar
millster
Posts: 2752
Joined: Tue Jun 18, 2002 4:49 am

Re: Fellow computer geeks, I need your help. (Mr. Poopypants)

Post by millster »

What language is your script? VBScript?
-Millster-
2006 Toyota Matrix XR
1995 Saab 9000CSE 2.3T
1986 Jaguar XJ6 Vanden Plas (GM Drivetrain Conversion)
2007 Outback XT EJ257 2.6L Build
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Re: Fellow computer geeks, I need your help. (millster)

Post by Mr. Poopypants »

Straight DOS login script, nothing fancy.
A bartender is just a pharmacist with a limited inventory.
User avatar
millster
Posts: 2752
Joined: Tue Jun 18, 2002 4:49 am

Re: Fellow computer geeks, I need your help. (Mr. Poopypants)

Post by millster »

Well... that does bump the difficulty up significantly (as I haven't used a straight batch file in a while). I'll see if I can dredge anything up, but as memory serves there aren't any date related functions for a batch file.
-Millster-
2006 Toyota Matrix XR
1995 Saab 9000CSE 2.3T
1986 Jaguar XJ6 Vanden Plas (GM Drivetrain Conversion)
2007 Outback XT EJ257 2.6L Build
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Re: Fellow computer geeks, I need your help. (millster)

Post by Mr. Poopypants »

Quote, originally posted by millster »Well... that does bump the difficulty up significantly (as I haven't used a straight batch file in a while). I'll see if I can dredge anything up, but as memory serves there aren't any date related functions for a batch file.Yeah, I'm going old school. I think there is a way but I have been searching and can't find anything that is useful.
A bartender is just a pharmacist with a limited inventory.
User avatar
joatmon
Posts: 10178
Joined: Fri Mar 21, 2003 5:19 am
Location: Room 101

Re: Fellow computer geeks, I need your help. (Mr. Poopypants)

Post by joatmon »

what version of windows? Is it a batch program, or a script in a switch.inf file? Do you want the script to run every wednesday, or to run every day and then just do something special if it is wednesday?If it's a batch file, you can set up a scheduled task to run every wednesday, so that the script gets run only on wednesday, and the script itself doesn't care what day it is.
Image
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Re: Fellow computer geeks, I need your help. (joatmon)

Post by Mr. Poopypants »

It's actually a few diffrent versions of windows that will be using the script. And it is just a batch that is initiated by the PDC on logon. Is there a way to include the script in the scheduled tasks without going to every computer and adding it in?I have not done scripts in forever, so I am really rusty.
A bartender is just a pharmacist with a limited inventory.
User avatar
joatmon
Posts: 10178
Joined: Fri Mar 21, 2003 5:19 am
Location: Room 101

Re: Fellow computer geeks, I need your help. (Mr. Poopypants)

Post by joatmon »

if it's a batch file, something like this might work. Probably a fancier way to do it, and you'd need to change the temp file location to a place where the user can create a fileQuote »date /T > c:pptest1.txtset WEDNESDAY=for /F "tokens=1" %%i in (c:pptest1.txt) do if %%i EQU Wed set WEDNESDAY=truedel c:pptest1.txtif DEFINED WEDNESDAY goto :dostuffgoto :donothing:dostuffecho All the cool poopypants stuff happens here:donothing
Image
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Re: Fellow computer geeks, I need your help. (joatmon)

Post by Mr. Poopypants »

Dayum!Thanks a bunch joat, I'll give that a shot.
A bartender is just a pharmacist with a limited inventory.
NSimkins
Global Moderator
Posts: 3091
Joined: Sat Jun 08, 2002 5:43 am

Re: Fellow computer geeks, I need your help. (Mr. Poopypants)

Post by NSimkins »

Quote, originally posted by Mr. Poopypants »And it is just a batch that is initiated by the PDC on logon. Just curious, you mention a PDC. Are you running an older Windows NT domain (PDC/BDC) or Win2k/2k3 active directory?
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Re: Fellow computer geeks, I need your help. (NSimkins)

Post by Mr. Poopypants »

Quote, originally posted by NSimkins »Just curious, you mention a PDC. Are you running an older Windows NT domain (PDC/BDC) or Win2k/2k3 active directory?It's actually a mixed network (read:My boss has no clue what he's doing)We have mostly Win2k but there are a few NT servers. We are running AD but my boss has no clue how to use it IMHO and so we are using yesterday's technology tomorrow.In my last job, we had all Win2K3. I LOVE IT! Using active directory cut my leg work in half because I didn't have to go around to each computer to make any config changes.
A bartender is just a pharmacist with a limited inventory.
ullbergm
Posts: 554
Joined: Sun Jul 21, 2002 9:27 am

Re: Fellow computer geeks, I need your help. (joatmon)

Post by ullbergm »

Quote, originally posted by joatmon »if it's a batch file, something like this might work. Probably a fancier way to do it, and you'd need to change the temp file location to a place where the user can create a fileFYI... If you want to get rid of the temp file this works for me (atleast on xp)Quote »set WEDNESDAY=for /F "tokens=1" %%i in ('date /t') do if %%i EQU Wed set WEDNESDAY=trueif DEFINED WEDNESDAY goto :dostuffgoto :donothing:dostuffecho All the cool poopypants stuff happens here:donothing
Car: Two-tone Base Abyss, Moons and tunes, Power packageMods: 20% tint, Reflective Black GrafxWerks Overlays, German Hella Horns, Hardwired Valentine One, red interior dome lights, custom cargo floormat, police scanner, ham radio, cellphone kit and a bunch of antennas on topWishlist: Rubber floormats, million dollars
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Re: Fellow computer geeks, I need your help. (joatmon)

Post by Mr. Poopypants »

Joat, I gave that a shot and since it's wednesday, it worked, I changed the day in the script to Thursday and ran it and it still ran, it didn't just close.*edit* Nevermind, I'm a dope!
A bartender is just a pharmacist with a limited inventory.
User avatar
joatmon
Posts: 10178
Joined: Fri Mar 21, 2003 5:19 am
Location: Room 101

Re: Fellow computer geeks, I need your help. (ullbergm)

Post by joatmon »

I tried that, but used back tick instead of apostrophe (` instead of ' ) and couldn't make it work so I went with the temp file. I'll blame it on Cursed unix csh influence it's happy with an apostrophe, thanks. i'm on XP also, not sure if date /T works on older windows versions.Can also cut out a few more lines by making it:Quote »set WEDNESDAY=for /F "tokens=1" %%i in ('date /t') do if %%i EQU Wed set WEDNESDAY=trueif NOT DEFINED WEDNESDAY goto :donothingecho All the cool poopypants stuff happens here:donothingand to make it run on a different day change Wed to Thu, Fri, Sat, etc in the for line
Image
ullbergm
Posts: 554
Joined: Sun Jul 21, 2002 9:27 am

Re: Fellow computer geeks, I need your help. (joatmon)

Post by ullbergm »

Quote, originally posted by joatmon »I tried that, but used back tick instead of apostrophe (` instead of ' ) and couldn't make it work so I went with the temp file. I'll blame it on Cursed unix csh influence it's happy with an apostrophe, thanks. i'm on XP also, not sure if date /T works on older windows versions.lol, i did to. and then i figured i'd try it with '.. here is yet another variation of the scriptQuote »for /F "tokens=1" %%i in ('date /t') do goto %%igoto end:Wedecho Doing stuffgoto end:Mon:Tue:Thu:Fri:Sat:Sungoto end:end
Car: Two-tone Base Abyss, Moons and tunes, Power packageMods: 20% tint, Reflective Black GrafxWerks Overlays, German Hella Horns, Hardwired Valentine One, red interior dome lights, custom cargo floormat, police scanner, ham radio, cellphone kit and a bunch of antennas on topWishlist: Rubber floormats, million dollars
Mr. Poopypants
Posts: 3428
Joined: Mon Nov 18, 2002 11:59 pm

Re: Fellow computer geeks, I need your help. (joatmon)

Post by Mr. Poopypants »

OK, everything is working great. Thank you for all your help!!
A bartender is just a pharmacist with a limited inventory.
Post Reply