![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | .bat parameters Hi Folks, Appologies in advance if this is not the right place to post this but I coud'nt find any groups specific to batch files... I have a batch file that calls to a url to gather data and dump it into a SQL DB. The command takes a bunch of parameters including url, server and login info, and beginning and ending dates. I would like to be able to run the batch file overnight and have the date parameters equal the previous day in a mm/dd/yyyy format. Any help would be fantastic as I'm sort of new to scripting. TIA! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: .bat parameters "Stephen" <Stephen@newsgroup> wrote in message news:AF48AD29-FD76-4B43-BCA1-412572D9CC72@newsgroup Quote: > Hi Folks, > > Appologies in advance if this is not the right place to post this but I > coud'nt find any groups specific to batch files... > > I have a batch file that calls to a url to gather data and dump it into a > SQL DB. The command takes a bunch of parameters including url, server and > login info, and beginning and ending dates. > > I would like to be able to run the batch file overnight and have the date > parameters equal the previous day in a mm/dd/yyyy format. > > Any help would be fantastic as I'm sort of new to scripting. > > TIA! question. Here is a hybrid VB Script/Batch solution that will always generate the desired format, regardless of your OS's regional settings (e.g. MM/DD/YYY or DD/MM/YYYY). @echo off set Scr=c:\TempVBS.vbs set VB=echo^>^>%Scr% cd 1>nul 2>%Scr% %VB% dYesterday = DateAdd("d", date(), -1) %VB% wscript.echo right("0" ^& month(dYesterday), 2) _ %VB% ^& "/" ^& right("0" ^& day(dYesterday), 2) _ %VB% ^& "/" ^& year(dYesterday) for /F %%a in ('cscript //nologo %Scr%') do set MyDate=%%a del %Scr% echo Yesterday=%MyDate% |
My System Specs![]() |
| | #3 (permalink) |
| | Re: .bat parameters "Stephen" <Stephen@newsgroup> wrote in message news:732572AD-E48B-4F40-9E0E-F8FCF53AC81E@newsgroup Quote: > perfect! exactly what I was looking for. > > Thank you very much! > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| parameters in .net | .NET General | |||
| Parameters | PowerShell | |||
| Far Cry parameters | Vista Games | |||
| Startup parameters | Vista mail | |||
| Parameters with ScriptMethod? | PowerShell | |||