cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
robg3381
Level 9
Report Inappropriate Content
Message 1 of 7

EEDK - Trouble getting EEDK to properly execute Batch file

I have a Powershell script I'd like to deploy and I'm having trouble getting it to work on EEDK.  But during my trials of "testing", I have created a simple BAT file with the following below in it.  For some reason, this does not work.  If I run psexec /s /i cmd.exe, then run the batch file there (to force it to run as SYSTEM), it works fine.  I also have made a EEDK with a basic BAT file with only a msiexec command string in it...and that works fine.  But why would the code below not run?

 

Also - Does anyone know if there are logs for EEDK to further investigate errors?

 

Any assistance would be appreciated.

md c:\temp\test-file
echo "blah" >c:\temp\test-file\myfile.txt

 

 

Labels (2)
6 Replies
cdinet
Employee
Employee
Report Inappropriate Content
Message 2 of 7

Re: EEDK - Trouble getting EEDK to properly execute Batch file

Try this - don't necessarily add the logging to the bat file itself, but add this to the command you are running when you configure it in eedk.  I would put the file in a directory already existing.

batfilename.bat > c:\windows\temp\myfile.txt 2>&1

https://www.robvanderwoude.com/battech_redirection.php

 

 

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

robg3381
Level 9
Report Inappropriate Content
Message 3 of 7

Re: EEDK - Trouble getting EEDK to properly execute Batch file

Same issue/result.  I have the same BAT file and in EEDK I select File and then in command to run, I have: "Test1-file.bat > c:\windows\temp\Test1-file.bat 2>&1" (without quotes).  I run on a system and nothing.  If I run via psexec /s /i cmd.exe, it does as we would expect and creates test1-file.bat under c:\windows\temp.

 

2 things I'm trying to understand.  1) Is the batch file even running and if so then 2) does EEDK not allow file-level actions like copy/create files 

 

I was using the echo>>file.txt as a test to see where errors were occurring, but that isn't working nor is trying to do something like copy a file from 1 directory to another.  It makes me think the BAT file isn't even running.  So trying to better understand why a basic BAT wouldn't run when using file-level commands when a basic BAT using a msiexec would.

cdinet
Employee
Employee
Report Inappropriate Content
Message 4 of 7

Re: EEDK - Trouble getting EEDK to properly execute Batch file

I will try testing that when I am back in the office next week

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

robg3381
Level 9
Report Inappropriate Content
Message 5 of 7

Re: EEDK - Trouble getting EEDK to properly execute Batch file

Bump.  Did you (or anyone) get a chance to try this out.

cdinet
Employee
Employee
Report Inappropriate Content
Message 6 of 7

Re: EEDK - Trouble getting EEDK to properly execute Batch file

So sorry, I must have overlooked this.  Let me work on it today.

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

cdinet
Employee
Employee
Report Inappropriate Content
Message 7 of 7

Re: EEDK - Trouble getting EEDK to properly execute Batch file

Ok, I created a bat file with exact parameters that you had in your test that you posted.  The command to run was test.bat, checked it into epo, replicated to distributed repos and deployed it to my test server (win 2016).  It created the folder and the file successfully.  I did the same thing to Windows 10 system and it also created the file successfully.  So, bat files do run - possibly something in the way you have the eedk package configured?  I am attaching mine as a sample for you to compare.

 

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use our Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from product experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by employees.
Join the Community
Join the Community