Solved

Net Send command not functioning with schtasks batch script

Posted on 2007-03-24
10
845 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 350 total points
ID: 18786716
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
ID: 18786769
Is the Messenger service running? NET SEND wont work without it.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18786775
"I have tested the net send and it does work"... must be...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Author Comment

by:nappy_d
ID: 18788040
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
ID: 18788608
Did you try adjusting the /tr parameter as suggested above?
0
 
LVL 32

Author Comment

by:nappy_d
ID: 18789976
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
ID: 18796742
Try restarting the service...
Start->Run->services.msc
Locate Scheduled Task - right-click and click Restart
0
 
LVL 32

Author Comment

by:nappy_d
ID: 18797529
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
ID: 18797534
I have raised my frustration value of this issue :-)
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18797556
..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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

623 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