sql server - Powershell Keeps Resetting To Default Temp Folder -


i running powershell script extracts data database. however, not have enough space on default %appdata%local/temp/ folder. know because error:

exception calling "executenonquery" "0" argument(s): "incorrect key file table 'c:\windows\servic~2\networ~1\appdata\local\temp#sql7ec_3_3.myi'; try repair it"

to fix issue trying change temp folder powershell. have changed in regedit to:

tmp   d:\temp temp  d:\temp 

in addition run code @ start of script:

# set environmental variables [environment]::setenvironmentvariable("temp", "d:\temp\") [environment]::setenvironmentvariable("temp", "d:\temp\") [environment]::setenvironmentvariable("tmp", "d:\temp\")  # navigate these temp folders $tempdir = [system.io.path]::gettemppath() cd $tempdir # returns 'd:\temp\' 

however, when script runs still error message:

exception calling "executenonquery" "0" argument(s): "incorrect key file table 'c:\windows\servic~2\networ~1\appdata\local\temp#sql7ec_3_3.myi'; try repair it"

any advice on why defaulting %appdata% folder , how change it?

i found solution, , environmental variables. correctly changed temp environment powershell, however, since called db db doing actual calculation , using own temp folder separate powershell. when changed temp file location mysql database worked perfectly.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -