- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 04:27 AM
Hi
I am trying to run command on Windows system from Discovery pattern -> debug mode -> command prompt.
I want to list directory 'c:\Program Files' (in the directory name there is a space).
There is no problem in listing directory where no space character is there, but when ' ' is in place - I face the issue.
The ways I tried to list directory - but with no success:
dir 'c:\Program Files'
dir c:\Program` Files
dir c:\'Program Files'
dir c:\Program^ Files
Do you have ideas how to solve that and successfully list the directory with space character in the name?
Kind regards
Renata Sieczka-Parcej
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 03:06 PM - edited 07-19-2024 03:10 PM
Hi @Renata7 ,
There is an alternative approach to view file folders inside c:\programfiles inside the pattern designer debug mode.
step1 : create a step in the pattern designer and choose ' parse file' operation
step 2: click on browse button on the screen. then you can view all the files folders on that windows server.
Please refer to the attached screenshot.
Please mark my solution as helpful, if it is resolving your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 10:49 AM
@Renata7 - This was little tricky..
This will do the trick for you:
dir + " \"/Program Files\""
Before running the command, midserver actually enforces the usage of chcp 65001 in cmd. The actual command for the above would look like this.
cmd /c "chcp 65001 & dir "/Program Files" >> output_6db22650-f8c5-421d-8518-35e3b697ce5a.txt
you can test your command string by setting chcp 65001 in local cmd terminal [default might be likely 437]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 11:03 AM
Thank you for sharing @Aneesh-D ! This is definitely geek stuff!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 03:06 PM - edited 07-19-2024 03:10 PM
Hi @Renata7 ,
There is an alternative approach to view file folders inside c:\programfiles inside the pattern designer debug mode.
step1 : create a step in the pattern designer and choose ' parse file' operation
step 2: click on browse button on the screen. then you can view all the files folders on that windows server.
Please refer to the attached screenshot.
Please mark my solution as helpful, if it is resolving your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 06:51 AM
Hi @Renata7,
When you type the command :
dir /X
The result gives you the shortname of the folder as well as the long ones :
example
07/05/2022 07:24 <DIR> PerfLogs
20/05/2025 08:18 <DIR> PROGRA~1 Program Files
20/05/2025 14:56 <DIR> PROGRA~2 Program Files (x86)
You can then use the short name (the one with the ~). example :
dir c:\progra~1
Hope this helps !
Iklef