Hi!

I have a bat-script in a postinstallation task, it`s start fine BUT K2000 thinks the installations is done and restart the computer when the scripts is running. Can I delay the restart or something ?

Many thx!
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0
can you share your bat script?
Answered 06/17/2015 by: SMal.tmcc
Red Belt

  • net use x: \\10.102.130.18\c$

    set source=X:\Win7\PSTools /y
    mkdir c:\PSTools
    set destination=C:\PSTools
    xcopy %source% %destination%

    C:\PsTools\PsExec.exe /accepteula \\10.102.130.18 "C:\updates\cmd\DoUpdate.cmd
Please log in to comment
0
try this

start /wait net use x: \\10.102.130.18\c$

set source=X:\Win7\PSTools /y
mkdir c:\PSTools
set destination=C:\PSTools
start /wait xcopy %source% %destination%

start /wait C:\PsTools\PsExec.exe /accepteula \\10.102.130.18 "C:\updates\cmd\DoUpdate.cmd

Answered 06/17/2015 by: SMal.tmcc
Red Belt

  • also another thing you can do since you own a k2000 is go to \\ikbox\peinst\winpe_build\amd64\windows\system32 (or x86) and get the file ksleep.exe, add that to your image and that allows you to easily put delays in your scripts (c:\temp\ksleep.exe 30) causes a 30 second delay between steps.
  • Thx, first I will test start /wait commands, have made the changes now and start a new installation. Hopefully it will work now! =)
    • should do it, pretty sure psexec was being called before everything was copied. I have ran into that problem in the past with some of my scripts
Please log in to comment
0
Did not work with start /wait, scripts start fine, but after about 15-20 sec computer restart and the installation is done.
Answered 06/17/2015 by: Swede
Blue Belt

  • post your command file
    • Command file? You mean my BAT script ?
      • the file you are calling with psexec. C:\updates\cmd\DoUpdate.cmd
  • also just noticed, hopefully a typo, the double quote is missing after the .cmd call
    • No, I have only have one double quote
      • Is a big cmd, I have upload it to dropbox. Link is: https://www.dropbox.com/s/pq7j6bm1v1v56qb/DoUpdate.cmd?dl=0
      • try either removing that one or add one and see if it runs while I look at the cmd file
Please log in to comment
0
Have add one double quote now, maybe is the command file is the problem, not the batch file ?
Answered 06/17/2015 by: Swede
Blue Belt

  • You are right it is huge. Checking it in between image tests and I just got back from Vacation so still getting caught up, may take me a few to scan. It could be in the cmd especially with all the err checks that skip to other areas. Something could be causing it to jump to the end and miss major parts very easily
    • if you run it from your machine to another manually does it work?
      • Yes working good
Please log in to comment
0

also looking at network share calls from explorer should look more like


start /wait C:\PsTools\PsExec.exe /accepteula \\10.102.130.18\C$\updates\cmd\DoUpdate.cmd
Answered 06/17/2015 by: SMal.tmcc
Red Belt

Please log in to comment
0
Maybe I should skip call the cmd-file, and call the Updateinstaller.exe (WSUS) ?
Answered 06/17/2015 by: Swede
Blue Belt

  • would be better. also you can call the wuauclt with the switches to have it attach to wsus and update thru it. http://www.itninja.com/question/using-wsus-as-a-post-install-task
    • But I don`t find any silent switches for Updateinstaller.exe
Please log in to comment
Answer this question or Comment on this question for clarity