Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-10-11
4
Medium Priority
?
250 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 375 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
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…
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…

885 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