Solved

Net Send command not functioning with schtasks batch script

Posted on 2007-03-24
10
830 Views
Last Modified: 2012-06-27
Hi,

I have been fighting to get schtasks working on my Windows XP clients. As users logon, a batch script runs and does the following:

- schtasks /create /tn "TempoNag" /sc minute /mo 1 /ru %computername%\administrator /rp myAdminPassword /tr \\serverName\SysVol\ADDomainName\Policies\{E29BFD55-6B5D-4A93-B0AB-EB1B05682F3E}\User\Scripts\Logon\netSendWarnMsg.bat"

- The task is created properly

- The task is supposed to do this: net send %computername% "You have more than two weeks of outstanding time sheets. Please Complete these time sheets."

- The problem I have is that the task runs but it does not do the net send pop-up message.

- I have tested the net send and it does work, but not from the schtasks.

Anyone have any ideas?

0
Comment
Question by:nappy_d
  • 5
  • 4
10 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 350 total points
Comment Utility
Check the log file - Start->Run->C:\Windows\schedlgu.txt for an indication of why it's failing...you might also try adjusting your run line to:

/tr "%comspec% /c \\serverName\SysVol\ADDomainName\Policies\{E29BFD55-6B5D-4A93-B0AB-EB1B05682F3E}\User\Scripts\Logon\netSendWarnMsg.bat"
0
 
LVL 70

Expert Comment

by:KCTS
Comment Utility
Is the Messenger service running? NET SEND wont work without it.
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
"I have tested the net send and it does work"... must be...
0
 
LVL 32

Author Comment

by:nappy_d
Comment Utility
Hmmm,

I see these errors in the logs.  It seems to be going back and forth between password being invalid and invalid working directory.  I know that password is correct because it adds the task :(

"TempoNag.job" (netSendWarnMsg.bat)
      Finished 25/03/2007 9:13:00 AM
      Result: The task completed with an exit code of (1).
"TempoNag.job" (netSendWarnMsg.bat) 25/03/2007 9:14:00 AM ** WARNING **
      Invalid working directory..
      The specific error is:
      0x0000052e: Logon failure: unknown user name or bad password.
      Verify that the directory exists and try again.
"TempoNag.job" (netSendWarnMsg.bat)
      Started 25/03/2007 9:14:00 AM
"TempoNag.job" (netSendWarnMsg.bat)
      Finished 25/03/2007 9:14:00 AM
      Result: The task completed with an exit code of (1).
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
Did you try adjusting the /tr parameter as suggested above?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 32

Author Comment

by:nappy_d
Comment Utility
Yes  I did.  Also, the schedlgu.log does not seem to be logging any errors any more.

The schtasks does not seem to be logging any info any longer.
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
Try restarting the service...
Start->Run->services.msc
Locate Scheduled Task - right-click and click Restart
0
 
LVL 32

Author Comment

by:nappy_d
Comment Utility
SO I stopped the service, cleared the log and restarted the service.

After doing that, here is the newest output, but I don't get the messenger popup.

"Task Scheduler Service"
      Started at 26/03/2007 10:39:06 PM
"TempoNag.job" (cmd.exe)
      Started 26/03/2007 10:41:00 PM
"TempoNag.job" (cmd.exe)
      Finished 26/03/2007 10:41:00 PM
      Result: The task completed with an exit code of (1).
0
 
LVL 32

Author Comment

by:nappy_d
Comment Utility
I have raised my frustration value of this issue :-)
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
..and thats with which version of the taskrun line?
You might try putting some redirects in your code to determine if theres any output...

>> c:\output.txt

at the end of any command should redirect the output to that file...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now