Automate a batch file when booting rescue media


Author
Message
Baysailor
Baysailor
New Member
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 18, Visits: 53
I was wondering if it is possible to run a batch file automatically when booting Macrium rescue media?  I have successfully created and stored a batch file on the USB but have not found a way to have it run when the rescue media boots. 

What I am doing for now is booting rescue then opening a command window to run the batch file.  This somewhat automates being able to see the NAS on the LAN instead of always entering the data each time. I would just like to completely automate it, if possible.

Thanks

Edited 2 October 2022 5:36 PM by Baysailor
jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)
Group: Forum Members
Posts: 13K, Visits: 79K
Yes, though you would have to perform this customization every time you rebuilt your Rescue Media.  And I would recommend putting the batch file itself somewhere in the WIM file.  If you do, then the virtual disk created to host the extracted contents of the WIM file is always assigned X, so when you add a line to startnet.cmd to call your batch file, take that into account when specifying the path to the batch file within the WIM.  Also note that Reflect itself customizes startnet.cmd, so I would preserve all of that as well.

The accepted answer in this thread describes the steps to mount a WIM file, customize the startup file it contains, and save your changes: https://serverfault.com/questions/85579/windows-pe-autorun-scripts

Edited 2 October 2022 8:31 PM by jphughan
Baysailor
Baysailor
New Member
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 18, Visits: 53
Hi,
Thanks for the quick response. I took a quick look at the link you provided. I am currently using WinRE, would I need to switch to WinPE?

jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)
Group: Forum Members
Posts: 13K, Visits: 79K
No. WinRE is based on WinPE, so it would work the same way.
Baysailor
Baysailor
New Member
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 18, Visits: 53
Great, I will see what I can do with it.

Dan Danz
Dan Danz
Master
Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)Master (1.9K reputation)
Group: Forum Members
Posts: 870, Visits: 7.8K
Baysailor - 2 October 2022 5:35 PM
I was wondering if it is possible to run a batch file automatically when booting Macrium rescue media?  I have successfully created and stored a batch file on the USB but have not found a way to have it run when the rescue media boots. 

What I am doing for now is booting rescue then opening a command window to run the batch file.  This somewhat automates being able to see the NAS on the LAN instead of always entering the data each time. I would just like to completely automate it, if possible.

Thanks

@Baysailor I see that @jphughan has answered your specific question, and I have no comment on that.  His advice is usually right on. 
But I wondered if you knew that you can set Network Share defaults in Reflects global Defaults.   I use it and the connection to my repository is automatically established when I boot rescue media.  Here's the Knowledge Base article about it.

 L.W. (Dan) Danz, Overland Park KS 
 Reflect v8.1.7469+ on Windows 11 Home 22H2-22621.1702+        
 Reflect v8.1.7469+ on  Windows 10 Home/Pro 22H2-19045.2965+  


Baysailor
Baysailor
New Member
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 18, Visits: 53
Hi Dan,
Thanks for that idea, it seems it will be easier to do.  I have been playing with modifying the wim file but have not successfully been able to see my Nas without typing in the credentials.  I will give this a try.

Edit: Actually forgot, I don't have to type them in, I open a command window and run a batch file. I may play with trying to get a batch file to run when the rescue media boots for a couple of my computers that don't have Macrium Reflect installed.

Edited 3 October 2022 11:14 PM by Baysailor
Baysailor
Baysailor
New Member
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 18, Visits: 53
Even with the credentials entered into the Desktop App the Rescue media did not "see" my NAS.  I still had to run the batch file.  I am not sure what I may be doing wrong, the test showed my credentials were good.

jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)Macrium Evangelist (21K reputation)
Group: Forum Members
Posts: 13K, Visits: 79K
Try a forced WIM rebuild of the Rescue Media.  Open Rescue Media Builder and hold Ctrl down to reveal an arrow on the Build button.  Click that arrow and click Force WIM Rebuild.  A change in network credentials doesn't trigger an automatic rebuild, but if you force one, then the current saved credentials will get baked into the Rescue Media, which might cover you.

Baysailor
Baysailor
New Member
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 18, Visits: 53
I will try that today, thank you.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Login

Explore
Messages
Mentions
Search