commands that work outside of script dont work if put inside script

can some one shed some light on this quirk i tried escaping but still
doesnt seem to work

kd> aS resfol “.\scripts\hobocopy %tmp%
.\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp”

kd> al
Alias Value


resfol .\scripts\hobocopy %tmp%
.\scriptresults%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp

kd> .shell -ci “uf NdisAllocateCloneNetBufferList” ${resfol}

<.shell waiting 10 second(s) for process>
HoboCopy (c) 2006 Wangdera Corporation. xxxxx@wangdera.com

Starting a full copy from C:\DOCUME~1\Admin\LOCALS~1\Temp to
F:\windbg\612windbg\scriptresults\2011_08_10
<.shell waiting 10 second(s) for process>
<.shell running: .shell_quit to abandon, ENTER to wait>Copied directory
Backup successfully completed.
Backup started at 2011-08-10 15:45:32, completed at 2011-08-10 15:45:49.
1 files (15.49 KB, 1 directories) copied, 4 files skipped
.shell: Process exited

i added the above commands inside a file so that i can invoke it later
but seems it is not working
kd> $$>a< scripts\cpydotsh.txt NdisAllocateCloneNetBufferList
<.shell waiting 10 second(s) for process>
HoboCopy (c) 2006 Wangdera Corporation. xxxxx@wangdera.com

<.shell waiting 10 second(s) for process>
Starting a full copy from C:\DOCUME~1\Admin\LOCALS~1\Temp to
F:\windbg\612windbg\scriptresults\2011_08_10
<.shell waiting 10 second(s) for process>
<.shell running: .shell_quit to abandon, ENTER to wait>Copied directory
Backup successfully completed.
Backup started at 2011-08-10 15:46:16, completed at 2011-08-10 15:46:36.
0 files (0.00 bytes, 1 directories) copied, 5 files skipped
.shell: Process exited

kd> al
No aliases

the contents of script file is as follows
aS resfol “.\scripts\hobocopy %tmp%
.\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp”
.block{
.shell -ci “uf ${$arg1}” ${resfol}
}
ad /q resfol

hobocopy is a cmdline utility that uses vss volume shadow service

windows inbuilt vssadmin doesnt seem to provide a way to copy a single
file from the shadow


thanks and regards

raj_r

You might be getting bitten by the way the script file is parsed/executed.
In the case of scripts processed with $$>a<, the script is condensed into a
single line with all newlines replaced with semicolons. So, while you think
that the result of this:

.shell -ci “uf ${$arg1}” ${resfol}
}

Would be a shell command of:

.\scripts\hobocopy %tmp%
.\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp

It might actually be:

.\scripts\hobocopy %tmp%
.\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp;

Due to the conversion of the newline at the end into a semicolon. This might
be enough to throw off the application and cause a failure.

Should be easy enough to test the theory, try adding a semicolon at the end
of the command and see if the application handles it. Alternative, Process
Monitor traces might be enlightening.

-scott


Scott Noone
Consulting Associate and Chief System Problem Analyst
OSR Open Systems Resources, Inc.
http://www.osronline.com

“raj_r” wrote in message news:xxxxx@windbg…

can some one shed some light on this quirk i tried escaping but still
doesnt seem to work

kd> aS resfol “.\scripts\hobocopy %tmp%
.\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp”

kd> al
Alias Value


resfol .\scripts\hobocopy %tmp%
.\scriptresults%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp

kd> .shell -ci “uf NdisAllocateCloneNetBufferList” ${resfol}

<.shell waiting 10 second(s) for process>
HoboCopy (c) 2006 Wangdera Corporation. xxxxx@wangdera.com

Starting a full copy from C:\DOCUME~1\Admin\LOCALS~1\Temp to
F:\windbg\612windbg\scriptresults\2011_08_10
<.shell waiting 10 second(s) for process>
<.shell running: .shell_quit to abandon, ENTER to wait>Copied directory
Backup successfully completed.
Backup started at 2011-08-10 15:45:32, completed at 2011-08-10 15:45:49.
1 files (15.49 KB, 1 directories) copied, 4 files skipped
.shell: Process exited

i added the above commands inside a file so that i can invoke it later
but seems it is not working
kd> $$>a< scripts\cpydotsh.txt NdisAllocateCloneNetBufferList
<.shell waiting 10 second(s) for process>
HoboCopy (c) 2006 Wangdera Corporation. xxxxx@wangdera.com

<.shell waiting 10 second(s) for process>
Starting a full copy from C:\DOCUME~1\Admin\LOCALS~1\Temp to
F:\windbg\612windbg\scriptresults\2011_08_10
<.shell waiting 10 second(s) for process>
<.shell running: .shell_quit to abandon, ENTER to wait>Copied directory
Backup successfully completed.
Backup started at 2011-08-10 15:46:16, completed at 2011-08-10 15:46:36.
0 files (0.00 bytes, 1 directories) copied, 5 files skipped
.shell: Process exited

kd> al
No aliases

the contents of script file is as follows
aS resfol “.\scripts\hobocopy %tmp%
.\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp”
.block{
.shell -ci “uf ${$arg1}” ${resfol}
}
ad /q resfol

hobocopy is a cmdline utility that uses vss volume shadow service

windows inbuilt vssadmin doesnt seem to provide a way to copy a single
file from the shadow


thanks and regards

raj_r

@###$$UO$UO$UP$UPU$PU$ !!@!#@##$*&*(&^#*&*^#$((_)*@)*@

thanks scott ill remember to add a space to and then a new line :slight_smile:

.\scripts\hobocopy C:\DOCUME~1\Admin\LOCALS~1\Temp
.\scriptresults\2011_08_10 shl*.tmp ;

or make all the script in one line
.\scripts\hobocopy C:\DOCUME~1\Admin\LOCALS~1\Temp
.\scriptresults\2011_08_10 shl*.tmp

instead of being normal

.\scripts\hobocopy C:\DOCUME~1\Admin\LOCALS~1\Temp
.\scriptresults\2011_08_10 shl*.tmp;

processmon traces are indeed enlightening

lkd> $$>a< scripts\cpydotsh.txt IopCreateFile
.\scripts\hobocopy %tmp%
.\scriptresults%DATE:~6,4%%date:~3,2%%date:~0,2%_%TIME:~1,1%Hr%TIME:~3,2%Min%TIME:~6,2%Sec
shl*.tmp
HoboCopy (c) 2006 Wangdera Corporation. xxxxx@wangdera.com

Starting a full copy from C:\DOCUME~1\Admin\LOCALS~1\Temp to
F:\windbg\612windbg\scriptresults\2011_08_11_0Hr36Min50Sec
<.shell waiting 10 second(s) for process>
Copied directory
Backup successfully completed.
Backup started at 2011-08-11 00:36:50, completed at 2011-08-11 00:36:53.
1 files (23.81 KB, 1 directories) copied, 2 files skipped
.shell: Process exited

On 8/10/11, Scott Noone wrote:
> You might be getting bitten by the way the script file is parsed/executed.
> In the case of scripts processed with $$>a<, the script is condensed into a
> single line with all newlines replaced with semicolons. So, while you think
> that the result of this:
>
> .shell -ci “uf ${$arg1}” ${resfol}
> }
>
> Would be a shell command of:
>
> .\scripts\hobocopy %tmp%
> .\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp
>
> It might actually be:
>
> .\scripts\hobocopy %tmp%
> .\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp;
>
> Due to the conversion of the newline at the end into a semicolon. This might
> be enough to throw off the application and cause a failure.
>
> Should be easy enough to test the theory, try adding a semicolon at the end
> of the command and see if the application handles it. Alternative, Process
> Monitor traces might be enlightening.
>
> -scott
>
> –
> Scott Noone
> Consulting Associate and Chief System Problem Analyst
> OSR Open Systems Resources, Inc.
> http://www.osronline.com
>
> “raj_r” wrote in message news:xxxxx@windbg…
>
> can some one shed some light on this quirk i tried escaping but still
> doesnt seem to work
>
>
> kd> aS resfol “.\scripts\hobocopy %tmp%
> .\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp”
>
> kd> al
> Alias Value
> ------- -------
> resfol .\scripts\hobocopy %tmp%
> .\scriptresults%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp
>
> kd> .shell -ci “uf NdisAllocateCloneNetBufferList” ${resfol}
>
> <.shell waiting 10 second(s) for process>
> HoboCopy (c) 2006 Wangdera Corporation. xxxxx@wangdera.com
>
> Starting a full copy from C:\DOCUME~1\Admin\LOCALS~1\Temp to
> F:\windbg\612windbg\scriptresults\2011_08_10
> <.shell waiting 10 second(s) for process>
> <.shell running: .shell_quit to abandon, ENTER to wait>Copied directory
> Backup successfully completed.
> Backup started at 2011-08-10 15:45:32, completed at 2011-08-10 15:45:49.
> 1 files (15.49 KB, 1 directories) copied, 4 files skipped
> .shell: Process exited
>
>
> i added the above commands inside a file so that i can invoke it later
> but seems it is not working
> kd> $$>a< scripts\cpydotsh.txt NdisAllocateCloneNetBufferList
> <.shell waiting 10 second(s) for process>
> HoboCopy (c) 2006 Wangdera Corporation. xxxxx@wangdera.com
>
> <.shell waiting 10 second(s) for process>
> Starting a full copy from C:\DOCUME~1\Admin\LOCALS~1\Temp to
> F:\windbg\612windbg\scriptresults\2011_08_10
> <.shell waiting 10 second(s) for process>
> <.shell running: .shell_quit to abandon, ENTER to wait>Copied directory
> Backup successfully completed.
> Backup started at 2011-08-10 15:46:16, completed at 2011-08-10 15:46:36.
> 0 files (0.00 bytes, 1 directories) copied, 5 files skipped
> .shell: Process exited
>
>
> kd> al
> No aliases
>
>
> the contents of script file is as follows
> aS resfol “.\scripts\hobocopy %tmp%
> .\scriptresults\%DATE:~6,4%%date:~3,2%%date:~0,2% shl*.tmp”
> .block{
> .shell -ci “uf ${$arg1}” ${resfol}
> }
> ad /q resfol
>
> hobocopy is a cmdline utility that uses vss volume shadow service
>
> windows inbuilt vssadmin doesnt seem to provide a way to copy a single
> file from the shadow
>
>
>
>
> –
> thanks and regards
>
> raj_r
>
>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


thanks and regards

raj_r