This question may be duplicate but since I didn't find any answer I am posting it here
My username has space in between; so how should I write it while using runas; should I use double quote or single quote or \
e.g. runas /noprofile /user:mymachine-pc\john smith cmd
in above e.g john & smith have space in-between
My cmd contains path,double quote etc ; so how should I pass whole thing as cmd to runas ; for e.g.
cmd=icacls "C:\Users\Public\Public Desktop" /GRANT John smith:F /T
I want to run above command as
"runas /noprofile /user:mymachine-pc\john smith icacls "C:\Users\Public\Public Desktop" /GRANT John smith:F /T
Now above command has lot of problem ; I am really confused; john smith has admin right also; and I am trying to run this from batch file
Try escaping inner quotes.