Solved

Net Send with Yes/No or some kind of If statement???

Posted on 2004-10-11
4
216 Views
Last Modified: 2010-04-10
I have a script that net send's a message that something is happening. I do not want the user to be able to click OK or close  the alert or anything until the event has happened. Is there a way to have a yes/no type thing, like vbYesNo, using net send? Here's how it is used in my .cmd script:

@echo off
ftp -s:ftp-ls.scr ftp.host.com > %temp%\ftp-ls.tmp 2>&1
find /i "FromOffice.mdb" "%temp%\ftp-ls.tmp"
If "%errorlevel%" == "1" (
Net Send %computername% You Already Have The Most Current Data File. No File Was Downloaded.
Goto End
)
Net Send %computername% Now Downloading The Most Current Data File.
ftp -s:ftp-get.scr ftp.host.com > NUL
copy C:\mdb_download\FromOffice.mdb C:\FromOffice.mdb
Net Send %computername% Download Complete.
:End
del %temp%\ftp-ls.tmp
0
Comment
Question by:horstuff
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Mazaraat
ID: 12282715
You would have to rework the script into a vbscript, but yes it can be done.  I will post a script either later tonight, or tomorrow morning for you that will do this.
0
 

Author Comment

by:horstuff
ID: 12282795
Thank you, thank you. A vbscript would be perfect if that would work (because I have worked with them a little bit before). Thanks.
0
 
LVL 12

Accepted Solution

by:
Mazaraat earned 125 total points
ID: 12291534
I started to write you a script and realized it was going to take awhile, but came across this one already mostly completed =)

I could hve it check sizes to verify if the file is the same to make sure it has the latest file...?


'===============Cut-N-Paste==============
Option Explicit
On Error Resume Next

Dim WshShell, FSO

Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
      msgbox "File transfer inprogress, click ok and wait for Next Message",1
WshShell.Run "ftp -s:c:\scripts\workarea\ftp_check.scr FTP_HOST_NAME",2,True
      IF FSo.fileexists("c:\fromoffice.mdb") then
      msgbox "File transfer complete",1
      End If
Set FSO = nothing
Set Wshshell = nothing
'===============Cut-N-Paste==============

Code inside something like this:
ftp.scr
'===============Cut-N-Paste==============
open ftp.yourserver.com
username
password
cd mdb_download
get FromOffice.mdb C:\FromOffice.mdb
bye
'===============Cut-N-Paste==============
0
 

Author Comment

by:horstuff
ID: 12414197
Thanks.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help with VLAN issue 6 59
Expanding Subnet Mask 20 109
Cisco 3560 switches not seeing VTP V3 12 53
Wireless scope on sever with DSL connection 9 23
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

778 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