Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

Embedding files and using with %MYFILES%

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler
View previous topic :: View next topic  
Author Message
wolfdogg



Joined: 20 Apr 2009
Posts: 3

PostPosted: Mon Apr 20, 2009 3:15 pm    Post subject: Embedding files and using with %MYFILES% Reply with quote

Sorry that I'm probably asking something that's been asked. I really did search, but I'm still confused on how to do this.

I've been using WinRar for a long time to build .exes and send down to laptops for people at work, via a weburl. I'm hoping to replace that process with this to make it a bit more transparent. In my WinRar package, I include osql.exe and updatesql.sql script, as well as the batch file. My batch file simply calls osql and sql script in the same line.

I'm totally confused on how to use the %MYFILES% paramater or if I can for this. I can write my simple little batch file, as I've currently been using it:

Code:
@echo off
echo updating laptop database...
osql -ddatabasename -Uuser -Ppassword -iupdatesql.sql -n
echo.
pause


I try to add the %MYFILES% option:

Code:
@echo off
echo updating laptop database...
CALL %MYFILES%\updatesql.sql
CALL %MYFILES%\osql.exe
osql -ddatabasename -Uuser -Ppassword -iupdatesql.sql -n
echo.
pause


At this point, is it possible to include osql.exe and updatesql.sql and make them run via the embedded files tab or do these files need to already reside on the laptops? How do I call them?

It might not be possible to do this in this way.. but just wanting to make sure it's not something I'm doing wrong before giving up.

Thank you!
Back to top
wolfdogg



Joined: 20 Apr 2009
Posts: 3

PostPosted: Mon Apr 20, 2009 7:18 pm    Post subject: Got it! Reply with quote

Nevermind.. figured it out. I was making it too hard. %MYFILES% is not documented well anywhere, but once I figured it out, it was quite easy. No need to have a separate call to osql. All I did was attach my sql script in the 'Embedded Files' tab and put the following source code in for the batch file:

Code:
@echo off
echo updating laptop database...
osql -ddatabasename -Uuser -Ppassword -i%MYFILES%\updatesql.sql -n
echo.
echo If the above shows (1 row affected) and there are no errors reported, the update was successful.  You may exit this program.
pause


Runs great.. just a console window showing and everything else in the background as I wanted... in case anyone else needs the help. Smile

Peace!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group