You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.2 KiB
51 lines
1.2 KiB
#write argsrecord.txt to cwd |
|
|
|
set fd [open [file join [pwd] argsrecord.txt] w] |
|
set output "" |
|
append output "argc: $::argc" \n |
|
append output "argv one arg per line, each line followed by dotted line." \n |
|
foreach a $::argv { |
|
append output $a \n |
|
append output [string repeat - 40] \n |
|
} |
|
append output "****** raw args******" \n |
|
puts -nonewline $fd $output |
|
set output "" |
|
|
|
package require twapi |
|
set rawcmdline [twapi::get_process_commandline [pid]] |
|
append output $rawcmdline \n |
|
append output "****** ******" \n |
|
|
|
|
|
puts -nonewline $fd $output |
|
set output "" |
|
|
|
set cl_to_argv [twapi::get_command_line_args $rawcmdline] |
|
|
|
append output "======twapi CommandLineToArgvW interpretation of args =====" \n |
|
foreach ca $cl_to_argv { |
|
append output $ca \n |
|
append output [string repeat = 40] \n |
|
} |
|
append output \n |
|
|
|
puts -nonewline $fd $output |
|
set output "" |
|
|
|
package require punk::winrun |
|
set cl_to_argv [punk::winrun::unquote_wintcl $rawcmdline] |
|
append output "======winrun::unquote_wintcl interpretation of args =====" \n |
|
foreach ca $cl_to_argv { |
|
append output $ca \n |
|
append output [string repeat = 40] \n |
|
} |
|
append output \n |
|
|
|
puts -nonewline $fd $output |
|
close $fd |
|
|
|
return 0 |
|
|
|
|
|
|
|
|