Easy one? Have vbs logon script run local executeable

Hi,

I use a vbs logon script at my domain controllers.

I need to run an application from the client computers' C: drive when 
they log on...

The logon script code below tries to run MyApp for the domain 
controller's C: disk, I need it to be run from the clients' C: disk.

Set WshShell = WScript.CreateObject("WScript.Shell")
ResultCode = WshShell.Run("C:\Program Files\MyApp.exe", 1, true)

How do I do that...?

regards jake
0
Jake
2/8/2010 10:05:53 AM
scripting.vbscript 564 articles. 0 followers. Follow

3 Replies
681 Views

Similar Articles

[PageSpeed] 12


"Jake" <jake44@gmail.com> said this in news item 
news:eGVyNZKqKHA.5760@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I use a vbs logon script at my domain controllers.
>
> I need to run an application from the client computers' C: drive when they 
> log on...
>
> The logon script code below tries to run MyApp for the domain controller's 
> C: disk, I need it to be run from the clients' C: disk.
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
> ResultCode = WshShell.Run("C:\Program Files\MyApp.exe", 1, true)
>
> How do I do that...?
>
> regards jake

You missed out on some double quotes. Modify your code as below, then run it 
from a Command Prompt. What you see is exactly what the script interpreter 
passes to the Command Processor. If you typed the command as you see it on 
the screen, would it work? With those embedded spaces?

Set WshShell = WScript.CreateObject("WScript.Shell")
ResultCode = WshShell.Run("C:\Program Files\MyApp.exe", 1, true)
wscript.echo "C:\Program Files\MyApp.exe"
 

0
Pegasus
2/8/2010 11:25:30 AM
Aside from the required code correction that Pegasus pointed out. Your post 
is lacking some more detail. How are you applying the logon script, Group 
Policy or on the Users' Profile in AD? Is the script residing in the 
"sysvol\"domain name"\scripts" folder on the DC? How do you know each user is 
running the myapp.exe on the DC? Remove the path to myapp.exe on the DC and 
see if that produces any errors. I believe this post should be in the Servers 
group instead.
0
Utf
2/8/2010 3:23:01 PM

"Jake" <jake44@gmail.com> wrote in message 
news:eGVyNZKqKHA.5760@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I use a vbs logon script at my domain controllers.
>
> I need to run an application from the client computers' C: drive when they 
> log on...
>
> The logon script code below tries to run MyApp for the domain controller's 
> C: disk, I need it to be run from the clients' C: disk.
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
> ResultCode = WshShell.Run("C:\Program Files\MyApp.exe", 1, true)
>
> How do I do that...?
>
> regards jake

Like yours, our logon script is written in VBScript, and it is run from a 
domain controller. When our script runs, it runs on the PC we are logging 
into, and, in that context, "C:" is the hard drive on the workstation, not 
on the domain controllers.

If you wanted to run an executable actually located on a DC, you would have 
to calculate a path to it relative to the path to the script.

The script you supplied actually does do (or tries to do) what you say you 
want it to do. Does it work when you run it interactively from a 
workstation? If not, perhaps you have the path wrong - are you sure it's not 
"C:\Program Files\MyApp\MyApp.exe"?


/Al
 

0
Al
2/9/2010 4:22:24 AM
Reply:

Similar Artilces:

How do I print only one item on a page instead of multiple.
I'm trying to print out a badge in publishing on XP pro. and I only want to print out 1 badge and not a repeat of the same badge on the page. This was easy to do on 98 pub., all I had to do was x out the ones I didn't want on page preview. Is there a way to do this or am I goint to have to waste a sheet? "dummy06" wrote: > I'm trying to print out a badge in publishing on XP pro. and I only want to > print out 1 badge and not a repeat of the same badge on the page. This was > easy to do on 98 pub., all I had to do was x out the ones I didn't want on ...

easy tips
simple internet safety tips http://teaarts.blogspot.com/2010/05/use-with-caution.html junk ail spam ...

truncate the yaxis if one data point is MUCH higher than the rest
How do I truncate the y-axis of a bar graph if in the event that one data point is VERY high, and the others are very small? I would like to see the top of all the bars in my graph, but not the entire bar for the large data point. http://peltiertech.com/Excel/Charts/BrokenYAxis.html - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ steve wrote: > How do I truncate the y-axis of a bar graph if in the event that one data > point is VERY high, and the others are very small? I would like to see t...

Can't logon to OWA with particular username while mine is working fine #2
Hallo, I use OWA at home and it's working fine. When I want to logon with a particular username and password I can't login. The option on exchange for OWA is enabled. When I want to login I get the following error: "The page cannot be displayed" HTTP 500 - Internal server error Internet Explorer Thanx in advance ...

One Exchange server handling two forests
Hi, I currently have an AD forest (say xyz.com) that has and Exchange 2003 server installed. We have just inherited another domain (abc.com) and they would like to have Exchange functionality also. Is there any possibility of using the Exchange server in the xyz.com domain? Thanks for your help in advance. Greg On Tue, 29 Mar 2005 18:47:02 -0800, Greg Edmonds <GregEdmonds@discussions.microsoft.com> wrote: >Hi, > >I currently have an AD forest (say xyz.com) that has and Exchange 2003 >server installed. We have just inherited another domain (abc.com) and they >w...

Multiple Pivot tables from One selection
I would like 2 or 3 pivot tables to use on pivot table selection. I.e the selection criteria of the 1st pivot table on the menu page determines what the page data of the other pivot table displays on seperate sheets where the other pivot tables are contained. So the selection of one pivot table controls the rest. -- dapo ------------------------------------------------------------------------ dapo's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29967 View this thread: http://www.excelforum.com/showthread.php?threadid=496616 Check the "Synchronize 2 Piv...

CAsyncSocket sends from one computer to the other but not the other way around
I have written a chat server/client combo using delphi. I am rewriting it in MFC. I have the server component almost complete along with a test client, to the point where it is functional. When I test it on my dev machine it works almost flawlessly. However, when I take the server exe and move it to my other machine that I use for a server it doesn't work. What happens is the client sends the data but the server never recieves the data. The client returns the number of characters sent without an error, but the onrecieve event is never triggered on the server. These are two local machi...

Mail Merge only one row in dataset
Hi, Anyone have an idea why mail merge shows only one row in the dataset even I have chosen multiple lines in CRM? I will not get any error messages but still get only one row in the mail merge window that shows the data that's going to be processed in the MM regardless of how many rows I choose in CRM. Cheers, Pete Found out that the problem seems to be somewhere in the advanced find. If I choose the option in first window and in Merge section "all records on all pages" the merge works well. But if I try to pick only few lines from the page or do an advanced find, then t...

how do i import multiple data sets at one time?
I'm importing a bunch of data and I'm using the import external data command in the data menu. I click on my file and choose delimited and then add a space in the next screen. It turns out to be two columns of data. I do this 10 times and was wondering if there is a way to import all the data at one time to simply save time. If anyone out there has any ideas I'd love to hear them. Thanks in advance. Assuuming that the files are all of the same two-column format, in a DOS Command Prompt window: Copy File1.txt + File2.txt + File3.txt + File4.txt + File5.txt File2Import.tx...

one user can't see any free/busy info for other users
I have a user who can't see others free/busy info. Everybody can see her info but when she tries to setup a meeting with individuals (it doesn't matter who), she gets the slashes and "no information available" message. I've checked all of her local calendar options and nothing looks out of place. I've also tried starting Outlook with /cleanfreebusy and /cleanschedplus; no change. Any further suggestions? ...

two users, one email account
Windows XP Home and Outlook 2003 I have set up two Windows user accounts. I want both to be able to use exactly the same email account in Outlook - see the same read/unread/sent messages, etc. Can I do this, and if so, how? Stephen <none> wrote: > I have set up two Windows user accounts. I want both to be able to use > exactly the same email account in Outlook - see the same > read/unread/sent messages, etc. Can I do this, and if so, how? Add a mail profile for each user in Control panel, and when you add the Personal Folders service, point each profile to the same PST. T...

MS 3003 won't run
Hi all, hope someone can help. I have a copy of MS Money 2003 that I bought a few years ago. It worked fine back then but after a system crash and windows re-install I never bothered to relaod money until now. But now after I install it on my W98SE machine it seems to install fine but will not run. When I open the program it opens very briefly then immediately closes. I have tried re-installing and deleting the sample file with no luck. My old money data file is long gone so that can't be the problem. Any ideas? Respectfully, kman I meant to say MS Money 2003. I may just go buy...

Windows installer runs when opening Office 2003
I have both Office 2003 and Office 2007 installed on my XP Pro machine. Office 2007 is working just fine, but in the past month or so I see the Windows Installer preparing to install message every time I start Word, Excel, Access, or Publishing 2003. All four programs open after a minute or so; in Word I get an error message: "An error occurred and this feature is no longer functioning properly. Please run setup and select Repair." The other three programs do not display such a message. I have not installed Powerpoint 2003. I have tried running Setup from my Office 2...

Exchange 5.5 Last logon
Where can I view the last logon for a specific account? I've checked both the Public Info store and the Private Info store, but not all accounts are listed. There are many users I know have logged on that aren't listed there. Is there anyway to check the properties of a specific account and click a tab, then a button that would provide this info? Or anything like that? Thanks! To the best of my knowledge, there is no way to do this unless logging was activated in advance. Even then you will need to sort through thousands of records in App Event log. stev379 wrote: > Where ...

meeting to distribution list except one person
Hi, I have a distribution list of 14 people that I regularly send meeting requests to. Today I want to remove one person from the list. After selecting 'Add Others', picking the distribution list, and then expanding it to reveal all the names, I want to remove one of the people, but can find a way to do it. Other than adding the 13 names separtely, does anyone know how to do this? Thanks, Michele Aloha mjones, Open the distribution list from the address book (probably your Contacts folder) that it exists in. Find the person you want to remove and remove them, then save the ...

Run-time Error '438': Object doesn't support this property or method
Hello, does anyone see a problem with the following code? SelectInfo is defined as: Sub SelectInfo(ballotWkst As Worksheet)...Thanks!! Sub ImportOnBehalfOf() Dim wkbknum, thisnum As Integer Dim wkst As Worksheet Dim wkbk As Workbook For wkbknum = 1 To (Workbooks.Count - 1) For Each wkst In Workbooks(wkbknum).Worksheets If wkst.Name = "Ballot" Then SelectInfo (wkst) '<--doesn't like this line End If Next Next End Sub Waht happens if you either remove the parentheses or change it to us...

many to one account to contacts
I don't understand the relationship types in 3.0. I have a Contact who needs to appear in 7 different accounts for which he is a representative. In fact, this is a pretty common instance in our industry. However, I can't assign a Contact to an Account without creating him in the system 7 different times. This is unacceptable. Please tell me I am missing something easy. I have tried to set up a Relationship at the Account level but Contact is not in the drop-down list. Thanks all. You need to use relationships and relationship roles to do this (the 'relationships' n...

averaging from one selected cell to another #2
I have a table with x and y values. I have another z column. In the z column i want to be able to average between the x value along that row location to the cell that has a value below a certain number say 4y. ...

Create a form in one database and then copy and paste to another
You guys have been great with your help. I created a form in a database, quite by accident that I got it the way I wanted it as I am still learning by trial and error, and reviewing this board... Anyway, I created this form, tried to twick it and screwed it up totally. I have the form before I messes with it backed up on a zip drive. Is there anyway to copy just a form from one datebase and place into another database? There is also a few forms in templates that would work great for me with just a minor adjustment here an there, but how can I get them into the database without cre...

MFC and run-time lib dependencies
Hi, I am working on an installer (InstallShield X), and have come across a situation where I have dependencies on two different versions of the VC run-time libraries. My application requires the VC 7 run-time libraries, but a copy-protection product I use has a dependency on MFC 6.0, which in turn depends on the VC 6 run-time libraries. I'm wondering how best to resolve this...? Do I need to include in my installer both the VC6 and VC7 run-time library redistributables? Or, can I substitute the MFC 7.0 merge module (for the MFC 6.0 one), and thus only use the VC7 run-ti...

Problem displaying a form that runs queries
Hello, In Access 2007, I’m having a little issue displaying a form that runs queries on load. Below is my code. When I double click the form, the queries begin to run but the form only appears after the queries are done. If I put the code behind a command button it works fine. I can’t use a command button because I need the queries to run unattended when the DB opens. Where am I going wrong? Private Sub Form_Open(Cancel As Integer) DoCmd.MoveSize 2880, 4320 End Sub Private Sub Form_Load() DoCmd.SetWarnings False '********************************** 'QUERIES ...

Multiple instances of Outlook when executing multiple DoCmd.SendObject commands
Hello! The routine below works great when I send only one email. But when sending another email, I have to kill Outlook via Task Manager where it is immediately replaced by another session of Outlook and Outlooks again comes up. Any help or suggestions appreciated! Rbollinger ========================================================= Sub Send SendEmail() On Error GoTo Err_Command11_Click Dim stDocName, mTO, mCC, mSubject As String stDocName = "frmSnapShot" mTO = Forms!frmEmail!emailTO mCC = Forms!frmEmail!emailCC mSubject = Forms!frmEmail!Subject mpath =...

Automatic Macro execution
I have a DATA.CSV file with numerical data. I wish to view this data, using a chart and macro which is located in a different COIL_VIEWER.XLS excel file. Is there a way to open the DATA.CSV file, and automatically execute the macro which is located in the other file (COIL_VIEWER.XLS) without any operator intervention?? Thank you, JOhn Probably want to stick the macro in "personal.xls" and then people could open that CSV file with a click of a button on the tool bar. No programming required. Just record keystrokes. -- HansM "John Gilchrist" <tremont-tech@worl...

copying data from one book to another
hi, i have 2 workbooks. one, wbk1, contains 50 records(say) like a125 a237 a458 b965 b45 c115 c897 c564 c262 the second workbook ,wbk2, contains sheets named as a, b c i want to copy records from wbk1 starting with 'a' to wbk2 sheet named as a, similarly records starting with 'b' to wbk2 sheet named as b, and it goes on can it be done, pls help thanks a lot --- Message posted from http://www.ExcelForum.com/ If you are looking to get rid of one workbook and spreading the data over several sheets in another, then try the following. In the source workbook break the a1...

How to copy from one worksheet to another
I have a worksheet that contains several worksheets. I would like to get the information on tab Sheet 1 and copy cells (A2:O2) in a tab name Sheet 2. Can someone share the code to do that ? Or inform me where can I go to read about it in order to accomplish this. Your collaboration will be appreciated. Luis ...