Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

string - Need help with a Windows batch script which should set val of var based on part of a file name -


this not homework - have homework on batch scripting? need automate something. there hard-coded batch script meant run daily systems, , needs work in dynamic fashion. needs input build number, can deduced name of file located @ ... c:\dumplocation\. not @ batch scripting, , looking batch ninja. if me, code in python myself, cannot expect others install this. powershell not available on every windows computer, batch script lowest common denominator.

this should help: http://www.techsupportforum.com/microsoft-support/windows-xp-support/54848-set-variable-based-output-seach-string-batch.html

here want script do:

dirtolookat = 'c:\dumplocation\' # in location there should single file named # custom_somethingbuild34567client_12345.zip # want extract build number variable effect: buildnumber = '34567' # strings surround build number fixed. # if there more 1 zip file build number in it, # need print warning , pick largest one. # can rest. 

the following should well:

http://www.computing.net/answers/programming/batch-string-substitution/12097.html

please let me know if have questions.

assuming custom_somethingbuild , client_12345.zip constants, should trick:

@echo off setlocal enabledelayedexpansion  rem count of files in directory  set /a filecount=0 /f "tokens=* delims= " %%a in ('dir/s/b/a-d c:\dumplocation') ( set /a filecount+=1 )  rem if file count greater or equal 2, warn user if %filecount% gtr 1 echo total number of files in directory is:  %filecount%  rem if file count less or equal 0, pause , exit if %filecount% leq 0 pause & exit  :: each build number, use number if largest number :: in loop, we'll strip out assumed constants, leaving build number.  set build= set /a buildnum=0 /f %%a in ('dir /p /b c:\dumplocation') (    set build=%%a    set build=!build:custom_somethingbuild=!    set build=!build:client_12345.zip=!    if !build! gtr !buildnum! set /a buildnum=!build! )  echo greatest build number in directory is:  %buildnum%  pause 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -