Solved

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

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
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…

760 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

20 Experts available now in Live!

Get 1:1 Help Now