Solved

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

Posted on 2004-10-11
4
230 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
[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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 7 Internet issue 14 69
Mapping a folder on a NAS to a drive letter 2 44
Cisco router external connection issues. 6 32
Sonos and 5ghz 14 43
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

735 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