parameter

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
peterh
Newbie
Posts: 1
Joined: Thu Aug 19, 2010 4:27 pm

parameter

Post by peterh » Thu Aug 19, 2010 4:47 pm

Requiring a macro to export the registry

Code: Select all

Day>the_day
Month>the_month
Year>the_year
Hour>the_hour
Min>the_min

Let>filename=%the_year%%the_month%%the_day%  %the_hour%:%the_min%


Dialog>MyDialog
  Caption=Registry Snapshot
  Left=300
  Top=300
  Width=305
  Height=120
  Label=Type EnterSnapshotName:,5,5
  Edit=MyEdit,5,22,230,Type Something Here and Press 'Display'
  Button=Display,240,22,50,20,3
  Button=Exit Macro,5,50,100,20,2
  EndDialog>MyDialog

Label>MainLoop
  Show>MyDialog,result
  If>result=2,End
  If>result=3,Snapshot
  Goto>MainLoop

SRT>Snapshot
  Let>SaveName=%MyDialog.MyEdit%  %filename%
  MessageModal>%SaveName%
  RunProgram>C:\Windows\regedit.exe /E E:\Saves\%SaveName%.reg
END>Snapshot

Label>End

**************************************
MessageModal>%SaveName% works ok 
what doesn't work is %SaveName% in file location
if hard coded it works

Help would be appreciated
Thank you

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Thu Aug 19, 2010 6:38 pm

Looks like %SaveName% can have spaces embedded in it.... this is a problem unless you put double quotes around either the whole command line or the parms

Try
RunProgram>"C:\Windows\regedit.exe /E E:\Saves\%SaveName%.reg"

or

RunProgram>C:\Windows\regedit.exe /E "E:\Saves\%SaveName%.reg"

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts