Solved

Net Send command not functioning with schtasks batch script

Posted on 2007-03-24
10
843 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can’t delete a file 14 200
Which browser works with XP 16 442
Copy 20 files at a time from drive G to drive H 10 67
Remote start and stop of service 3 46
If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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