Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

File updater code issues


  • Please log in to reply
6 replies to this topic

#1 Vaine

Vaine

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:11:35 AM

Posted 20 January 2009 - 07:56 PM

I designed this code to update SAS without having to go to the website. I use all my programs like these on my USB flash drive and I want it to update it to that location. Well I try running this batch file and it opens the DOS menu and closes it. I would like to know what I am doing wrong and what I can do to make this work.

Here is the code I constructed:

:: SuperAntiSpyware Updater

@echo off

:: rem Save file as
SET GETFILE=http://downloads.superantispyware.com/downloads/SUPERAntiSpyware.exe
SET SAVEFILE=SuperAntiSpyware.exe
goto GetUpdate

:GetUpdate
%UTILPATH%\download.exe %GETFILE% /timeout:20 /update /output:"F:\PC Repair Programs"\%SAVEFILE% /overwrite

:END
endlocal


BC AdBot (Login to Remove)

 


#2 nigglesnush85

nigglesnush85

  • Members
  • 4,371 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:03:35 PM

Posted 21 January 2009 - 08:25 AM

Hello,


You might try turning the "echo off" to "echo on" http://www.ss64.com/nt/echo.html That should help diagnose the problem.
Regards,

Alan.

#3 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:11:35 AM

Posted 22 January 2009 - 08:54 AM

I got it to work. Here is my new code:

@rem ----- ExeScript Options Begin -----
@rem ScriptType: console
@rem DestDirectory: temp
@rem Icon: F:\PC Repair Programs\SuperAntiSpyware.exe
@rem OutputFile: F:\UpdateSAS.exe
@rem CompanyName: Blue Screen Inc.
@rem FileVersion: 1.0.0.0
@rem LegalCopyright:  2009 Blue Screen Inc. All Rights Reserved.
@rem ProductVersion: 1.0.0.0
@rem ----- ExeScript Options End -----

@echo off

COLOR 4f

ECHO. *********************************************
ECHO. ** Welcome to the SuperAntiSpyware Update Utility **
ECHO. *********************************************
ECHO.
ECHO. Note: As the update process begins, please be 
ECHO. patient while the program is being updated.
ECHO.
ECHO.
ECHO.
ECHO. 
ECHO. 

Pause
CLS

:: Combofix Updater

@echo off

:: rem Save file as
SET GETFILE=http://downloads.superantispyware.com/downloads/SUPERAntiSpyware.exe
SET SAVEFILE=SuperAntiSpyware.exe
goto GetUpdate

:GetUpdate
%F:%\Updaters\Downloader\download.exe %GETFILE% /timeout:20 /update /output:"F:\PC Repair Programs"\%SAVEFILE% /overwrite

Call Success.vbs


:END
endlocal

Is there a way I can center the PAUSE and the TEXT at the beginning? Like combofix? It is centered and I did some research but could not find anything.

Is there a way that I can insert an ERROR command that will CALL Error.vbs if it encounters an error updating? And to CALL Success.vbs if there is no error?

Edited by Vaine, 22 January 2009 - 08:55 AM.


#4 nigglesnush85

nigglesnush85

  • Members
  • 4,371 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:03:35 PM

Posted 24 January 2009 - 04:45 AM

Thats good news, have you looked at http://www.geocities.com/politalk/dos/batch.htm
Regards,

Alan.

#5 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:11:35 AM

Posted 24 January 2009 - 09:37 PM

Another function is the cursor placement. On a standard screen setting there are 80 horizontal columns and 25 vertical lines. You can place text or the cursor at any point with these codes:
[10;42H would put the location in row 10 and column 42. The uppercase H sets this function. If you wanted to center text, rather than spacing over to that point, you specify the line and column where you want the text to begin. This can get you around the shift that occurs if a line wraps because it is too long to fit on the screen. That could misalign all text that follows.
For more complete information on using ANSI,


What is this ANSI?

#6 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:08:35 AM

Posted 24 January 2009 - 11:05 PM

ANSI = American National Standards Institute. I think what's meant here is ASCII = American Standard Code for Information Interchange.

:: Combofix Updater <-- You're not doing what I think you're doing with this are you????? :thumbsup:

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#7 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:11:35 AM

Posted 26 January 2009 - 10:42 AM

Nope. I am not doing suck thing. Combofix Updates itself. There is no need to make something for that.

How would I center the PAUSE text and the text I made up? How could I use that code [10;42H in this to make it work?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users