Solved

Net Send command not functioning with schtasks batch script

Posted on 2007-03-24
10
835 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
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
 
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
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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
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…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

932 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

13 Experts available now in Live!

Get 1:1 Help Now