@ECHO OFF
set "str1=cd"
set "str2=%~dp0"
set "str5=CPCE Client\EfileServiceClient""
set "str4=%str1% %str2%%str5%"
Echo.%str4%
i want to execute the command which is existed in variable "str4" how to execute it....
Simply type %str4% in the command prompt or state it in a batch file to execute its value as a command line.
However, there are some issues in your code:
" too much at the str5 assignment, which must be removed; otherwise, the value of str5 equaled CPCE Client\EfileServiceClient";str5; spaces must be handled correctly, as you would type the command in the command prompt; arguments with spaces should be enclosed within "";cd command (in str1), spaces do not cause any problems, so it would also work without ""; however, for most commands, spaces most probably will cause troubles)The following adapted code will work:
@echo off
set "str1=cd"
set "str2=%~dp0"
set "str5=CPCE Client\EfileServiceClient"
set "str4=%str1% "%str2%%str5%""
%str4%
%str4%by itself as a command.