vbscript or batch file to play audio file for user on startup

Punkrulz

Somewhat eXPerienced
Joined
24 Dec 2001
Messages
790
Hey guys,

It has been requested to me that I setup something that will make it so that when a specific user logs in on any machine (this portion will be controlled by group policy), a specified audio file will play. This audio file will be played via network path. Unfortunately, I don't know anything about creating a batch file to do the job, and I know even less about VB. I just know how to make it so that it only works for this one user.

Any ideas?
 
Might be approaching this from a very basic perspective, but can't you just put a .bat file in the startup folder of that user, on the PC, and have it point to the audio file?

Nothing even fancy is needed in the batch file, just have the absolute path to the file you want to play. Something like this...

\\server01\folder\folder\folder\sound.wav

Then put either that batch file or a shortcut to that batch file in the startup folder for that user...

C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup

%USERNAME% = username of the user you want to put it under

I think that would do the trick?
 
Might be approaching this from a very basic perspective, but can't you just put a .bat file in the startup folder of that user, on the PC, and have it point to the audio file?

Nothing even fancy is needed in the batch file, just have the absolute path to the file you want to play. Something like this...

\\server01\folder\folder\folder\sound.wav

Then put either that batch file or a shortcut to that batch file in the startup folder for that user...

C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup

%USERNAME% = username of the user you want to put it under

I think that would do the trick?

Startup folder wouldn't work since he stated that the file is supposed to play on ANY machine this user logs into..

You can look at using a roaming profile for that one user.. or maybe just create a custom login script for that user to play the file.

edit: hmm.. just pointing a batch to the file name \\server\share\filename.wav would open up WMP and leave it open after the sound played though..

edit2: I suppose you could write a batch file that plays the file, then after it plays the file, run a command like pskill to kill the wmplayer.exe process.. that's a total hack though
 
Last edited:
Ah missed the part about any PC they login to. If that is the case then using a roaming profile would be the best bet.

Is there a way to tie into the player that you get for the Control Panel, the one where you can test out Sound Schemes? This would probably be able to play without needing an application, no?
 
Hehe, I thank you guys for your help, but I think you may be looking too far into this. :) The problem of running it on any PC for that user is NOT a problem! I can handle that just fine. I was simply going to associate either the vbscript or batch file with his username under Group Policy...

My problem:

I don't know how to make the batch file! What should I put into it??? Should I do VBScript, or Batch? No roaming profiles here guys. :) The path of the audio file will be on the network, it was emailed to me.
 
i think sound scheme is the way to go, create a custom sound scheme for the user, then change the normall xp login sound with the file u want?
 
I think setting a custom sound scheme per user is way too much administrative overhead. Would also mean they would have to login as that user, to each machine he would want to access - at least I think so.

I'm fiddiiling with a batch file for you, gimmie some more time :)
 
I think setting a custom sound scheme per user is way too much administrative overhead. Would also mean they would have to login as that user, to each machine he would want to access - at least I think so.

I'm fiddiiling with a batch file for you, gimmie some more time :)

I'm not sure if I've said this before kcnychief, but you're the man!
 
I'm not sure if I've said this before kcnychief, but you're the man!

funny.. kc usually says that to me after I write him a vbscript..

*pokes KC* hey kc.. don't forget to update the scores on sunday for fantasy football

/runs
 
I'm going to hit you with a rather large stick, very hard :p
 
funny.. kc usually says that to me after I write him a vbscript..

*pokes KC* hey kc.. don't forget to update the scores on sunday for fantasy football

/runs


Hey, he needs to get me my script before he gets you the scores to fanstasy foosball!
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back