And, if you change the first line to:

*SET Var1=%~1#*

Then, you get rid of " in the variable up front.


* *

*ASB* *http://about.me/Andrew.S.Baker* *Harnessing the Advantages of
Technology for the SMB market…

*



On Thu, Jul 28, 2011 at 8:34 AM, Ken Cornetet <[email protected]>wrote:

> From set /?****
>
> ** **
>
> set Var1=%1#****
>
> Sets “Var1” to first parameter passed to the batch file (%1) and appends a
> “#”****
>
> ** **
>
> set Var1=%Var1:"=%****
>
> Removes  all occurrences of the double-quote character in Var1****
>
> ** **
>
> set Var1=%Var1:\#=%****
>
> Removes all occurrences of “\#” in Var1****
>
> ** **
>
> set Var1=%Var1:#=%****
>
> Removes all occurrences of the hash character (“#”) in Var1****
>
> ** **
>
> Ken Cornetet 812.482.8499****
>
> To err is human - to moo, bovine.****
>
> ** **
>
> *From:* Oliver Marshall [mailto:[email protected]]
> *Sent:* Thursday, July 28, 2011 8:23 AM
> *To:* NT System Admin Issues
> *Subject:* Batch file syntax question****
>
> ** **
>
> Does anyone know what this does to this variable?****
>
> ** **
>
> set Var1=%1#****
>
> set Var1=%Var1:"=%****
>
> set Var1=%Var1:\#=%****
>
> set Var1=%Var1:#=%****
>
>  ****
>
> ****
>
>  ****
>
> ****
>
> Network Support
> Online Backups
> Server Management****
>
> ****
>
> Tel: 0845 307 3443****
>
> Email: [email protected]****
>
> Web: http://www.g2support.com****
>
> Twitter: g2support <http://twitter.com/home?status=@g2support>****
>
> Newsletter: http://www.g2support.com/newsletter****
>
> Mail: 2 Roundhill Road, Brighton, Sussex, BN2 3RF****
>
>  ****
>
> Have you said something nice about us to a friend or colleague ? ****
>
> Let us say thanks. Find out more at www.g2support.com/referral****
>
> ** **
>
> G2 Support LLP is registered at Mill House, 103 Holmes Avenue, HOVE****
>
> BN3 7LE. Our registered company number is OC316341. ****
>
> ** **
>
> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>
> ---
> To manage subscriptions click here:
> http://lyris.sunbelt-software.com/read/my_forums/
> or send an email to [email protected]
> with the body: unsubscribe ntsysadmin****
>
> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>
> ---
> To manage subscriptions click here:
> http://lyris.sunbelt-software.com/read/my_forums/
> or send an email to [email protected]
> with the body: unsubscribe ntsysadmin
>

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

<<image001.jpg>>

<<image002.png>>

Reply via email to