[scripting] RE: bat file will only run one time

2017-09-12 Thread Keith Garner
PowerShell: First you will need a function to write to an INI file: https://github.com/keithga/DeploySharedLibrary/blob/master/DeployShared/Windows/Set-PrivateProfileString.ps1 Next you will need a function to write to your Bootstrap or CustomSettings.ini file:

[scripting] bat file will only run one time

2017-09-12 Thread David Landry
Hi All, I will admit up front, my script write abilities are slim. I have this script that I found to insert a new line of text into an .ini file and it works perfectly But for just one time. During my testing I removed the inserted line and text and then reran the script. Only this time

[scripting] RE: bat file will only run one time

2017-09-12 Thread David Landry
Thank you to all for all the guidance. It is very much appreciated. From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Benke, Richard L. (WWRC) Sent: Tuesday, September 12, 2017 4:20 PM To: scripting@lists.myitforum.com Subject: [scripting] RE: bat file

Re: [scripting] RE: bat file will only run one time

2017-09-12 Thread Sean Martin
Next step is changing your admin password. - Sean > On Sep 12, 2017, at 12:39 PM, David Landry wrote: > > Thank you to all for all the guidance. It is very much appreciated. > > > From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] > On

[scripting] RE: bat file will only run one time

2017-09-12 Thread David Landry
That was it. Web page didn't specify and I don't have the experience to know the difference. Thanks again From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Aakash Shah Sent: Tuesday, September 12, 2017 3:26 PM To: scripting@lists.myitforum.com Subject:

[scripting] RE: bat file will only run one time

2017-09-12 Thread Matt Hebbel
I know this isn't batch or vbs, but if the CustomSettings.ini file is the INI file you're modifying, check out this link: https://www.scconfigmgr.com/2014/08/23/using-powershell-to-modify-settings-in-mdt-2013/ If you scroll down towards the bottom of the page, there's some excellent guidance

[scripting] RE: bat file will only run one time

2017-09-12 Thread Benke, Richard L. (WWRC)
I numbered the lines for reference. You're opening a file handle in line 13, but you're never closing it. This is leaving the file handle open for that instance of the script, which is preventing subsequent instances of the script from being able to open it. End your script with another

[scripting] RE: bat file will only run one time

2017-09-12 Thread Aakash Shah
That looks like VB code and should have the .vbs extension. I haven't checked the script itself, but see if using the .vbs extension instead of .bat helps. -Aakash Shah From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of David Landry Sent: Tuesday,