Posts Tagged ‘cmd’

http://stackoverflow.com/questions/8328338/how-do-you-utilize-more-than-9-arguments-when-calling-a-label-in-a-cmd-batch-scr

Use shift command 9 times to access the %10 argument as %1 and %11 argument as %2 … etc

Use %* to access all the arguments in any bat file and pass to other bat file.

Ex: Have following code in 1.bat

call 2.bat %*

Have following code in 2.bat

echo %*

echo %4

When you execute 1.bat 1 2 3 4 5 6 7 then it will display following output  ….

1 2 3 4 5 6 7

4

Date Time Using CMD

Posted: November 22, 2013 in CMD, Uncategorized
Tags: ,

%date:~-4,4%%date:~-7,2%%date:~-10,2%%time:~-11,2%%time:~-8,2%%time:~-5,2%

– Returns date time in YYYYMMDDHHMMSS format.

mstsc /admin /V: IP

Open cmd with Run as administrator and run following command …

sc.exe delete ReportServer
sc.exe delete ReportServer$MSSQLSERVER

Rename VSS files – command line command

Posted: July 1, 2011 in CMD
Tags: ,

ss.exe Rename $/Play/Servers.txt $/Play/Servers.txt.txt

You can create batch file (.bat) to run this on group of files in a VSS folder(s).

  • Set environment variable from command prompt –
    set ssdir=\\yourserver\VSS\VSProjects
  • Check environment variable whether set or not from command prompt –
    dir %ssdir%
  • Save directory file list to a file – dir /b > c:\files.txt