becraig
asked on
Delayedexpansion WOES
I have a startup script that needs to grab values from another script. (cmd files)
The variable values do not populate without delayedexpansion ( I am ok with this except for one thing)
I have a value that contains a "!" which gets lost once read with delayed expansion on - I am unable to manually adjust this value since it is dynamic.
Any ideas on how to work around this ?
Example:
net use !server!\filepath /user:!user! '!password!'
The password sometimes contains an exclamation and causes a break is there any way to handle this ?
The variable values do not populate without delayedexpansion ( I am ok with this except for one thing)
I have a value that contains a "!" which gets lost once read with delayed expansion on - I am unable to manually adjust this value since it is dynamic.
Any ideas on how to work around this ?
Example:
net use !server!\filepath /user:!user! '!password!'
The password sometimes contains an exclamation and causes a break is there any way to handle this ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys, I really thought I left this crap behind me :~(
So much for winpe and safeos testing.
Qlemo I wish I could use posh :~)
So much for winpe and safeos testing.
Qlemo I wish I could use posh :~)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Interesting, I always love when a solution isn't a solution...
The only reliable way is to switch off delayed expansion for as much as possible. Or switch to using PowerShell ;-).