Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 391 Vote(s) - 3.54 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what does it mean batch set variable=%variable:~1%

#1
Can anyone explain what is `:~1%` in the below statement in a batch file? I assigned the value of `%variable` to servername and tried `echo %variable`. I get the same server name as output. Can anyone explain how the statement below works?

set variable=%variable:~1%
Reply

#2
It's a syntax for substrings from the variable contents, in this case it removes the first character.

See `set /?` for help
Reply

#3
this is notation for subs string expansion , look at this out put form command line you will understand.

C:\>set temp=stackoverflow.com

C:\>echo %temp%
stackoverflow.com

C:\>echo %temp:~5%
overflow.com

C:\>echo %temp:~5,8%
overflow

C:\>

if you have not understood , here is syntax (in my words)

set variable=%variable:~startingCharector [,OptionalLenghtOfCharctors]%

where

`OptionalLenghtOfCharctors` by default it takes remaining characters of string.

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through