Reply
Old November 28th, 2006 Top | #1
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 104

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

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?

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old November 28th, 2006 Top | #2

OSNN Subscriber
OSNN Folding Team  
kcnychief's Avatar
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,961
Reputation: 4941
Power: 275

Default Re: vbscript or batch file to play audio file for user on startup

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?

XBOX Live Gamertag: kcnychief
kcnychief is offline   Reply With Quote
Old November 28th, 2006 Last edited by fitz; November 28th, 2006 at 7:11pm. | Top | #3

OSNN Subscriber
OSNN Folding Team  
fitz's Avatar
XPista7eopard*ix
Joined: April 2004
Location: Chicagoland
Posts: 3,861
Reputation: 2479
Power: 130

Default Re: vbscript or batch file to play audio file for user on startup

Originally Posted by kcnychief View Post
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
fitz is offline   Reply With Quote
Old November 28th, 2006 Top | #4

OSNN Subscriber
OSNN Folding Team  
kcnychief's Avatar
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,961
Reputation: 4941
Power: 275

Default Re: vbscript or batch file to play audio file for user on startup

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?

XBOX Live Gamertag: kcnychief
kcnychief is offline   Reply With Quote
Old November 28th, 2006 Top | #5
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 104

Default Re: vbscript or batch file to play audio file for user on startup

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.

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old November 28th, 2006 Top | #6

OSNN Subscriber  
Henyman's Avatar
Secret Goat Fetish
Joined: June 2002
Location: Dorset, England Posts: More Than You
Posts: 9,574
Reputation: 3410
Power: 220

Default Re: vbscript or batch file to play audio file for user on startup

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?
Henyman is offline   Reply With Quote
Old November 28th, 2006 Top | #7

OSNN Subscriber
OSNN Folding Team  
kcnychief's Avatar
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,961
Reputation: 4941
Power: 275

Default Re: vbscript or batch file to play audio file for user on startup

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

XBOX Live Gamertag: kcnychief
kcnychief is offline   Reply With Quote
Old November 28th, 2006 Top | #8
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 104

Default Re: vbscript or batch file to play audio file for user on startup

Originally Posted by kcnychief View Post
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!

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old November 29th, 2006 Top | #9

OSNN Subscriber
OSNN Folding Team  
fitz's Avatar
XPista7eopard*ix
Joined: April 2004
Location: Chicagoland
Posts: 3,861
Reputation: 2479
Power: 130

Default Re: vbscript or batch file to play audio file for user on startup

Originally Posted by Punkrulz View Post
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
fitz is offline   Reply With Quote
Old November 29th, 2006 Top | #10

OSNN Subscriber
OSNN Folding Team  
kcnychief's Avatar
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,961
Reputation: 4941
Power: 275

Default Re: vbscript or batch file to play audio file for user on startup

I'm going to hit you with a rather large stick, very hard

XBOX Live Gamertag: kcnychief
kcnychief is offline   Reply With Quote
Old November 29th, 2006 Top | #11
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 104

Default Re: vbscript or batch file to play audio file for user on startup

Originally Posted by fitz View Post
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!

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Batch File] How do you call a VBScript? drummer4lifex Web Design & Coding 1 June 13th, 2006 9:06pm
BATCH file help dillinja Web Design & Coding 0 March 24th, 2006 10:43am
Batch FIle PLEASE HELP arew264 Windows Desktop Systems 6 February 24th, 2005 1:56am
XP Batch file RogerPhillis Windows Desktop Systems 4 November 25th, 2002 12:18am
Auto Play an AUDIO File???? allan03 Windows Desktop Systems 4 April 21st, 2002 5:07am