Solved

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

Posted on 2004-10-11
4
233 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Suggested Solutions

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
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…
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…

731 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