Solved

Execute .bat file

  • 19 May 2023
  • 4 replies
  • 186 views

Hi,

I need to create sub directories for a list of users. I have the users in a table so I'm able to create a .bat file with the mkdir statements.

I can manually execute this file but I wonder if there is an option to execute this .bat file using TX?

icon

Best answer by Søren Sørensen 21 May 2023, 09:15

View original

4 replies

Userlevel 6
Badge +5

Hi @Lorenzo 

You should be able to execute the .bat file using this PowerShell script. For more info on PowerShell scripts and how to add them as an external executable, please see this guide

Start-Process -FilePath "C:\script.bat"

 

@Christian Hauggaard 

We use version 20.10.32.64 and it seems that you need version 6024. 

Although I see an External Executable folder in the Execution pane, I can't add a Powershell script or whatever .bat file.

So there is no option at all for our version of TX?

Userlevel 6
Badge +5

@Lorenzo correct, this feature is only for the new version. If using the old version you would have to set it up outside of TimeXtender. We will be releasing a migration tool which allows you to convert your existing projects to the new version. 

Userlevel 1
Badge +1

@Lorenzo 

I use xp_cmdshell in pre- or post-scripts at a couple of customer sites (version 20.10.x). It works really well and we have no security concerns in this regard. This is just an example (not a .bat file but you get the gist):

set @Command = 'dir "' + @Folder + '"'

insert into @Dir

  exec xp_cmdshell @Command

You might wish to try this while we wait for the migration tool to be released.

Reply