The scripts run once oly

I use sql developer version 3.2.20.09
i set the developer to look in "c:\scripts" directory the scripts.
when i execute the script (F5 or F9) (@wsession.sql for example) the first time works. from the second always generates the errors:
SEVERE
74
891
oracle.dbtools.worksheet.commands.scriptrunner.task.executor.DefaultStatementExecutorTask
java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:244)
SEVERE
73
1351784
oracle.dbtools.raptor.newscriptrunner.ScriptRunnerContext
java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:244)
if a restart the developer, the same problem occurs (works the first time and doesnt work from second).
if i take the sql inside the script and put it in the developer worksheet (the same place that i called @wsessoin,sql for example) and execute it (F5) it works fine.
any help?
thanks

Working with the developer to replicate this locally, I see it - he doesn't, and then we can progress to fix.
java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:### - this is happening in the 4.0 code base as well...

Similar Messages

  • Using an own function in a select how can i set that the function run once?

    Hi
    Using an own function in a select how can i set that the function run once, not in every row?
    Please help me
    Thanks
    Viktor

    Something like this ?
    SQL> select * from dept;
        DEPTNO DNAME                          LOC
            10 ACCOUNTING                     NEW YORK
            20 RESEARCH                       DALLAS
            30 SALES                          CHICAGO
            40 OPERATIONS                     BOSTON
    SQL> create or replace function ret_name (deptnum in number) return varchar2
      2  is
      3     name    varchar2(50);
      4  begin
      5     select dname into name
      6     from dept
      7     where deptno=deptnum;
      8     return name;
      9  exception
    10     when no_data_found then
    11             return('Not existent deptno');
    12* end;
    SQL> /
    Function created.
    SQL> select deptno, decode(rownum,1,ret_name(deptno),null) dname from dept;
        DEPTNO DNAME
            10 ACCOUNTING
            20
            30
            40
    SQL>

  • I created a script to add logos to photos at a club and now when I run the script, the script runs but does not actually place anything on the photo itself.  What's going on?

    I created a script to add logos to photos at a club and now when I run the script, the script runs but does not actually place anything on the photo itself.  What's going on?

    He meant post it here, of course, Louie!  How on Earth would you post it "on Photoshop" ? 
    Thank you for the belly laugh. 

  • Remove 1st & 2nd lines in 1st file, and 1st line in 2nd file. I want the headers to be the first line after the script runs!

    I have two files that look like this (Notepad++):
    In the first file, which has a date as a name and always ends in 'COV', I want to remove the 1st & 2nd lines.  All lines end in LF (LineFeed).  In the 2nd file, which has a date as a name and always ends in 'RSK', I want to remove the 1st line. 
    Basically I want only the headers.  I'm working with the code below.  I've tried several different iterations of
    reader.ReadLine().Skip(1);
    reader.ReadLine().Skip(2);
    reader.ReadLine().Skip(3);
    It never really gives me what I want, so I can't tell what's going on here.  I guess I'm missing something simple, but I don't know what.  Any ideas, anyone?
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    using System.Diagnostics;
    namespace ConsoleApplication1
    class Program
    static void Main(string[] args)
    string sourceDirectory = @"C:\Users\rshuell\Desktop\Downloads\Files";
    try
    var txtFiles = Directory.EnumerateFiles(sourceDirectory);
    foreach (string currentFile in txtFiles)
    if (currentFile.Contains("COV"))
    var items1 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine().Skip(2); // skip 2lines
    string line;
    while ((line = reader.ReadLine()) != null)
    items1.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items1);
    else
    var items2 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine().Skip(1); // skip one line
    string line;
    while ((line = reader.ReadLine()) != null)
    items2.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items2);
    catch (Exception ex)
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Call the ReadLine() twice if you want to skip the first two lines. Each call results in a single line being read:
    static void Main(string[] args)
    string sourceDirectory = @"C:\Users\rshuell\Desktop\Downloads\Files";
    try
    var txtFiles = Directory.EnumerateFiles(sourceDirectory);
    foreach (string currentFile in txtFiles)
    if (currentFile.Contains("COV"))
    var items1 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine(); //read line 1
    reader.ReadLine(); //read line 2
    string line;
    while ((line = reader.ReadLine()) != null)
    items1.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items1);
    else
    var items2 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine(); // skip one line
    string line;
    while ((line = reader.ReadLine()) != null)
    items2.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items2);
    catch (Exception ex)
    Calling the Skip method on the already read string returned by the ReadLine() method won't help you at all here. By the time you call the Skip method the line has already been read from the file. You must call the ReadLine() method for a new line being read.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • Running the Scripts of Essbase in Server rather than in Client

    Hi,
    We have Scripts which run for different Loads like INK/TONER/FAST etc. The Essbase Version we use is 11.1.2.2.
    The content of the Scripts are as below.
    INK.cmd
    del U:\FAST\Logs\Ink_Assumpt_Extract.log
    call C:\Hyperion\products\Essbase\EssbaseClient\bin\startEsscmd.bat U:\FAST\sub\sub\Ink_Assumpt_Extract_FAST.cmd
    cd U:\FAST\data\
    del Ink_Decay_Rates.OUT
    move Ink_Decay_Rates.dat Ink_Decay_Rates.OUT
    del Ink_Pen_Price.OUT
    move Ink_Pen_Price.dat Ink_Pen_Price.OUT
    del INKASM10.OUT
    move Assum10.dat INKASM10.OUT
    To run the above Script the User will install the Essbase Client in his PC and startEsscmd.cmd is executed as they will map the Folder to their PC using U Drive Version. This  folder exists in Server.
    Now the requirement is to change the Script running with User depending on Essbase Client. We need change the Script to run in Server itself when  the users runs the script.
    I want to execute this StartEsscmd.bat with the one available in Server as the below one
    call F:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin\startEsscmd.bat U:\FAST\sub\sub\Ink_Assumpt_Extract.cmd . Rather than users installing Client.
    Is this how we can make the script to run in Server itself. Or any other process. Please help on this.
    Regards,
    Naveen

    Hello Experts,
    These batch scripts are dependent on Informatica Environment as well. Once all the Essbase batch files runs there will be data files in DAT Folder and using the timestamp of current month these data files will be send to Informatica Env and there one Job runs which will convert all the .OUT files into a .DAT file and load into DB. Its the Process.
    Now we cant change the entire process but need to get rid of Essbase Client dependency.
    All i want to know is if we change the path of the files from
    call C:\Hyperion\products\Essbase\EssbaseClient\bin\startEsscmd.bat
    to
    call F:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin\startEsscmd.bat
    or
    call %ARBORTPATH%\bin\startEsscmd.bat
    will the files runs in server side. I tried with this but getting an error saying
    System cannot find the path specified. Please help.
    Regards,
    Naveen

  • Firefox does not load the first time I click on it -- a script appears which ischrome://webvideodownloader/content/utils.js:131 -- when I stop this script running I can then load firefox -- how can I keep this script from running

    I can still load it with the script running or attempting to run in the background but it makes firefox tremendously slow. After I click on stop running the script then everything seems to be ok.
    how do I get the script not to run in the first place.

    In Firefox the use of the term chrome refers to the user interface and other elements that are not part of the web pages.
    See https://developer.mozilla.org/en/Chrome
    Your problems seems to be caused by the GreaseMonkey extension.<br />
    See [[Troubleshooting extensions and themes]]

  • Securely deploying and using credentials within a script (not running the script under the credentials)

    Here is my scenario - I have SCOM 2007 R2 and on certain agents I want to execute a script. One of the actions of that script is to access a secured web page using a username and password via integrated authentication (IE pop-up for auth).
    The username and password that I need to use are unrelated to the Windows domain that the servers run in, meaning you can think of the website as if it were a public site (it isn't, but it has no security sharing with the domain where the agents run - no trust,
    no nothing).
    I can easily accomplish this by hard-coding the username and password within the script (powershell), however, I don't want to do this for security reasons. Here's a rough example of the relevant code:
    $targetURL = "https://somehost.somewhere.something/filename.zip"
    $path = "c:\downloads\filname.zip"
    $wclient = New-Object System.Net.WebClient
    $wclient.Credentials = New-Object System.Net.Networkcredential($uname, $pword)
    $wclient.DownloadFile( $url, $path )
    What I want is a way to pass the $uname and $pword variables to this script securely, with the script running on a schedule under SCOM. The SCOM agents run as localsystem and need to remain that way.
    I currently use Run-As accounts and profiles for other functions where the entire script runs under the run-as profile, but I can't figure out how to extract the username and passwords, and doubt it's even possible.
    To be clear, I cannot run the script under the given credentials as a Run-As account as those credentials are not known to the local server. I need to somehow pass the credentials to the script (other than hardcoding) or extract them from the run-as accounts.
    I've looked at the get-runasaccount cmdlet and can see some of the info there, but don't see a way to re-use, pass-through, or extract the password for use in my scenario.
    Any guidance? Can I get there from here?

    Hi, check this
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/ebfc706d-93be-4ca0-83e0-33d9e072fb97/powershell-script-monitor-with-encrypted-password?forum=operationsmanagerauthoring
    But you should not specify runas account for your workflow, just reference Runas Username and Password from Profile and use simple authentication. (The same way as in article above)
    So in the end your script will be executed by default action account but you'll pass username and password securely to your script.

  • Will scripts run automatically ?

    If I shut down my Mac everynight(I live in a time zone 6 hours ahead of Eastern US time), will the scripts run automatically when I start it up the next morning...or...do I need a special utility application for this ?

    these scripts are not worth worrying about. you should just leave them alone. the OS does a very good job of running them all by itself. and they are all quite useless anyway. many people (apparently yourself included) seem to think that these periodic scripts are important maintenance tools and will make your system run better and faster. nothing can be further from the truth.
    *monthly scripts* :
    1. archive and recycle fax logs. have you used your mac as a fax machine lately?
    2. write accounting information (total uptime of every account) in the monthly.out log.
    That's IT. so unless you use your mac as a fax machine (do you, really?) you don't need to run monthly scripts. EVER.
    *weekly scripts*:
    in snow leopard they do one thing ONLY: rebuild whois database. it's only useful if you are a unix user and actually use the whois terminal command at least on occasion. I'll bet my bottom dollar you never have and never will. then you don't need to run the weekly scripts either. EVER.
    *daily scripts*
    they do several things
    1. clean up the logs from /Library/Logs/CrashReporter which are more than 60 days old. hardly an urgent task. and those logs are really very few unless your system is seriously messed up. you can go a year without deleting any and will collect a few MBs at the most.
    2. delete junk from /tmp directory that's more than 3 days old.
    This is done automatically on every reboot without any periodic scripts. if you don't reboot the computer then daily scripts will run *no matter* the schedule. if you don't sleep the computer at night they'll run at night. if you do sleep the computer at night they will run first thing in the morning when the computer is turned on. again, zero need to reschedule anything.
    3. deletes files older than 7 days from /var/rwho. this is only relevant if you are running a unix network. otherwise there is nothing to delete - EVER.
    4. rotate accounting files. again, those are nonexistent unless you are a unix administrator.
    5. run the terminal command *df -l -h* and print out the output to daily.out. all this command does is list currently mounted hard drives. useless.
    6.print the current network status in daily.out. this is again just reporting not maintenance.
    7. Delete system messages. Once again this is relevant only for multi-user Unix systems.
    8. remove scratch fax files. see my comment above about using your mac as a fax machine.
    9. it writes some other accounting and system status info to daily.out. this is again only reporting and is ONLY actually present on unix networks.
    and that's all, folks.

  • Search for records in the event viewer after the last run (not the entire event log), remove duplicate - Output Logon type for a specific OU users

    Hi,
    The following code works perfectly for me and give me a list of users for a specific OU and their respective logon types :-
    $logFile = 'c:\test\test.txt'
    $_myOU = "OU=ABC,dc=contosso,DC=com"
    # LogonType as per technet
    $_logontype = @{
        2 = "Interactive" 
        3 = "Network"
        4 = "Batch"
        5 = "Service"
        7 = "Unlock"
        8 = "NetworkCleartext"
        9 = "NewCredentials"
        10 = "RemoteInteractive"
        11 = "CachedInteractive"
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0""
    or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>" -ComputerName
    "XYZ" | ForEach-Object {
        #TargetUserSid
        $_cur_OU = ([ADSI]"LDAP://<SID=$(($_.Properties[4]).Value.Value)>").distinguishedName
        If ( $_cur_OU -like "*$_myOU" ) {
            $_cur_OU
            #LogonType
            $_logontype[ [int] $_.Properties[8].Value ]
    #Time-created
    $_.TimeCreated
        $_.Properties[18].Value
    } >> $logFile
    I am able to pipe the results to a file however, I would like to convert it to CSV/HTML When i try "convertto-HTML"
    function it converts certain values . Also,
    a) I would like to remove duplicate entries when the script runs only for that execution. 
    b) When the script is run, we may be able to search for records after the last run and not search in the same
    records that we have looked into before.
    PLEASE HELP ! 

    If you just want to look for the new events since the last run, I suggest to record the EventRecordID of the last event you parsed and use it as a reference in your filter. For example:
    <QueryList>
      <Query Id="0" Path="Security">
        <Select Path="Security">*[System[(EventID=4624 and
    EventRecordID>46452302)]]</Select>
        <Suppress Path="Security">*[EventData[Data[@Name="SubjectLogonId"]="0x0" or Data[@Name="TargetDomainName"]="NT AUTHORITY" or Data[@Name="TargetDomainName"]="Window Manager"]]</Suppress>
      </Query>
    </QueryList>
    That's this logic that the Server Manager of Windows Serve 2012 is using to save time, CPU and bandwidth. The problem is how to get that number and provide it to your next run. You can store in a file and read it at the beginning. If not found, you
    can go through the all event list.
    Let's say you store it in a simple text file, ref.txt
    1234
    At the beginning just read it.
    Try {
    $_intMyRef = [int] (Get-Content .\ref.txt)
    Catch {
    Write-Host "The reference EventRecordID cannot be found." -ForegroundColor Red
    $_intMyRef = 0
    This is very lazy check. You can do a proper parsing etc... That's a quick dirty way. If I can read
    it and parse it as an integer, I use it. Else, I just set it to 0 meaning I'll collect all info.
    Then include it in your filter. You Get-WinEvent becomes:
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624 and EventRecordID&gt;$_intMyRef)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0"" or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>"
    At the end of your script, store the last value you got into your ref.txt file. So you can for example get that info in the loop. Like:
    $Result += $LogonRecord
    $_intLastId = $Event.RecordId
    And at the end:
    Write-Output $_intLastId | Out-File .\ref.txt
    Then next time you run it, it is just scanning the delta. Note that I prefer this versus the date filter in case of the machine wasn't active for long or in case of time sync issue which can sometimes mess up with the date based filters.
    If you want to go for a date filtering, do it at the Get-WinEvent level, not in the Where-Object. If the query is local, it doesn't change much. But in remote system, it does the filter on the remote side therefore you're saving time and resources on your
    side. So for example for the last 30 days, and if you want to use the XMLFilter parameter, you can use:
    <QueryList>
    <Query Id="0" Path="Security">
    <Select Path="Security">*[System[TimeCreated[timediff(@SystemTime) &lt;= 2592000000]]]</Select>
    </Query>
    </QueryList>
    Then you can combine it, etc...
    PS, I used the confusing underscores because I like it ;)
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Re -directing the script o/p to mail id

    Hi,
    i wrote a small script for automating the task( some xyz task) and how do i specify that the script out put to be send to my mail id with in he company network, so that no need to check the o/p when ever the script runs , just by mail can see the o/p.
    appreciate the help.
    susesun

    Hi Bhanuphani,
    To send a Sapscript as e-mail, you need to convert the spool request to PDF and send the e-mail with the PDF attached.
    Please, check out for the first step FM CONVERT_ABAPSPOOLJOB_2_PDF and CONVERT_OTFSPOOLJOB_2_PDF.
    To send the e-mail, check FM SO_NEW_DOCUMENT_ATT_SEND_API1 and Class CL_BCS.
    There are plenty of examples in SDN.
    Cheers,
    Andrés.

  • CS3 script runs slow with CS4 and CS5

    I have written a table transformation script for InDesign CS3, which formats an imported Excel table.
    With InDesign CS3 the script runs well. Now I tried the same script with InDesign CS4 and CS5 and it runs very slow. It's about 10 times slower than with CS3.
    I tried to turn off redrawing, but this didn't help. It even got slower again!
    Does someone has made similar experiences? Could you solve the performance issue?
    Do scripts in CS4/CS5 generally run slower than in CS3?
    Does CS4 differ so much to CS3 that the script runs 10 times slower?
    What can I do to improve the execution performance?
    Thanks for any tips / advices etc.

    I now have made some tests with profile / timing. Here are the results.
    you find the code snipped below. It iterates first over all rows and then over all cells inside of the row. In the cell iteration, the function hasGapInLineBelow(...) does more iterations.
    The example is with a table of 42 rows and 9 cells.
    I have compared CS3 and CS5
    there are 3 test cases:
    for 1/1 means: first for-loop is in iteration 1 and second for loop is in iteration 1 (statements for first row and first cell done)
    for 1/9 means: first for-loop is in iteration 1 and second for loop is in iteration 9 (statements for first row and all 9 cells of the row done)
    for 2/9 means: first for-loop is in iteration 2 and second for loop is in iteration 2 (statements for second row and all 9 cells of the row done)
    it's strange that normal variable assignments take lot of time (like the statement startPos = indexLeftNeightbourOfCurrentCell;) -> I don't understand why this can be so time consuming!?!
    it's also strange why in "for 1/9" and "for 2/9" variable assignments take much longer than in "for 1/1"...
    could I use another data type than array for the variable isMergedRow? Which one?
    do you know any performance optimizations?
    in which time unit ExtendScript Toolkit shows the measured periods?
    how are the times calculated in loops? Are these the times sumed up over all iterations or is it just the time for a single statement?

  • Right click on script"run with PowerShell"

    I have set the execution policy in GPO to remoteSigned, and it is working fine, when I run the script from cmd prompt powershell –f
    When I right click the script and choose “run with PowerShell” it starts with this text in red
    Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. 
    Due to the override, your shell will retain its current effective executionpolicy of RemoteSigned
    The script is working, but it do not look right for a user of the script.
    Sometimes when I run the script “run with PowerShell” it prompts the user to overwrite policy, again no matter if I choose yes or no, the script will run.
    I am running on Windows 8.1 Update 1 x64, Powershell 4.0
    Do anyone know how to fix?
    Kind Regards
    Jens
    Jens Lund

    There is another Group Policy setting that is setting a different policy. Post in the GP forum to get help with fixing this.
    Possibility #2.  You are setting the policy in your profile or on the command line.
    ¯\_(ツ)_/¯

  • User sites unreachable after weekly script run

    Server 10.3.9 on both my webserver and on my Xserve with RAID where my user sites are hosted.
    I have sites hosted directly on my webserver and my user sites are served through the webserver but site on the Xserve, shared through Open Directory.
    Everything works awesome except every Saturday morning, after the weekly script runs on both machines at 4:30 a.m., my users sites are no longer available through the webserver. If I reboot the webserver they come back just fine.
    I've looked through the weekly script and nothing was obvious to me that would break this connection.
    Has anyone else seen this?
    Thanks
    Eric

    Thanks for these tips. I've tried them and a few other things...
    It sounds, and I may be wrong, like you're proxying
    through your webserver to your file server for the
    user sites. The first thing will be to find out
    which machine is getting goofed up.
    Tomorrow, see if your regular websites are accessible
    after the script runs.
    The user sites are not available this morning through my webserver, as has been the case since installing the server in January. The regular (local) sites on the webserver are just fine.
    Try the user's sites directly
    from the file server, eliminating the webserver
    proxying.
    I don't usually run the webserver on my file server but I did fire it up this morning and was able to reach the user sites through it.
    If both of those are okay, then setup a
    terminal window on each machine, and on both machines
    do:
    tail -f /var/log/httpd/error_log
    and try hitting the user's sites through the
    webserver and see what messages come up on each
    machine, and post them.
    I don't get any error messages when accessing the user sites through the fileserver. I do get errors on the webserver when accessing user sites, saying "File does not exist:" then the path to the Network directory where the users site is. ( /Network/Servers/fileserver.address/Volumes/Home/username/Sites )
    This prompted me to try accessing user sites from one of my desktop machines (running OS X client 10.4.5) that is also connected to the fileserver with OD, and is running a webserver. That worked fine!
    I then tried to traverse the filesystem at the command line on my webserver to reach the users home sites and couldn't do it. I could do it on my desktop machine.
    So it appears that something on Server is breaking the AFP communication between the webserver and the fileserver when the periodic weekly scripts are run. I did try restarting AFP on the webserver just in case but that made no difference. I can't really restart AFP on the fileserver as I have users actively connected, but my guess is that is working just fine since I can access those shared volumes from my desktop machines.
    Instead of restarting whichever machine you've been
    restarting, try stopping and starting just the
    webserver to see if that takes care of the problem.
    I did try this and everything was the same as above.
    Strange that Server has this problem losing connection to AFP shares, but my clients don't. There isn't anything obvious to me in the weekly scripts that could cause this but I'll look again in case I missed this.
    Seems like others would have run across this??
    Note: a reboot of the webserver again this morning (after this testing) returned the users sites to my webserver. Doing an automatic reboot each week would be a kludge solution, but one that I really want to avoid if possible.
    Thanks for the troubleshooting tips. I hope you or someone else has some further advice...
    Eric
    iBook G4, iMac G5, Dual 2.5 GHz G5   Mac OS X (10.4.4)  
    Dual G4 and single Xserve with RAID   Mac OS X (10.3.9)  

  • Multi-Select Script Runs in ISE, not on remote Hyper-V Server

    Hello All!
    I've created  a powershell script to allow a user to launch one of several management tools on a Hyper-V server. The script runs fine in Powershell ISE on my system (none of the tools work, obviously) but when I run it on the remote server, these errors
    come up:
    At C:\Mgmt\MgmtSel.ps1:70 char:1
    + }
    + ~
    Unexpected token '}' in expression or statement.
    At C:\Mgmt\MgmtSel.ps1:72 char:1
    + }
    + ~
    Unexpected token '}' in expression or statement.
    At C:\Mgmt\MgmtSel.ps1:73 char:1
    + }
    + ~
    Unexpected token '}' in expression or statement.
    + CategoryInfo : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken
    When I paste it directly into the Powershell window, it runs fine. So strange! I know my brackets are correct, or it wouldn't run when pasted into the shell or in ISE. Anyway, any help you could provide would be appreciated. Thank you all for your time!
    Here's the script:
    <######################################################################
    Present user with options to launch one of several management programs
    Save as MgmtSel.ps1 in c:\Mgmt
    v 0.1 Basic Menu Presentation for different management tools
    Written By Ricky Carleton
    Based on code by Paul Westlake
    ######################################################################>
    $xAppName = ‘MgmtSel’
    [BOOLEAN]$global:xExitSession=$false
    function LoadMenuSystem(){
    [INT]$xMenu1=0
    [INT]$xMenu2=0
    [BOOLEAN]$xValidSelection=$false
    while ( $xMenu1 -lt 1 -or $xMenu1 -gt 4 ){
    CLS
    #… Present the Menu Options
    Write-Host “`n`tLogin Management Tools Selection – Version 0.1`n” -ForegroundColor Magenta
    Write-Host “`t`tPlease select the admin area you require`n” -Fore Cyan
    Write-Host “`t`t`t1. sconfig console” -Fore Cyan
    Write-Host “`t`t`t2. Corefig” -Fore Cyan
    Write-Host “`t`t`t3. Hyper-V Mgmt” -Fore Cyan
    Write-Host “`t`t`t4. Quit and exit`n” -Fore Cyan
    #… Retrieve the response from the user
    [int]$xMenu1 = Read-Host “`t`tEnter Menu Option Number”
    if( $xMenu1 -lt 1 -or $xMenu1 -gt 4 ){
    Write-Host “`tPlease select one of the options available.`n” -Fore Red;start-Sleep -Seconds 1
    Switch ($xMenu1){ #… User has selected a valid entry.. load next menu
    1 {
    CLS
    Write-Host “`t`tStarting sconfig`n” -Fore Cyan
    start c:\Windows\System32\sconfig.cmd
    2 {
    CLS
    Write-Host “`t`tStarting Corefig`n” -Fore Cyan
    C:\Corefig\COREFIG.PS1
    3 {
    while ( $xMenu2 -lt 1 -or $xMenu2 -gt 3 ){
    CLS
    # Present the Menu Options
    Write-Host “`n`tSelect the Hyper-V Mgmt Tool you would like to use`n” -Fore Cyan
    Write-Host “`t`t`t1. PSHVM30” -Fore Green
    Write-Host “`t`t`t2. ProHVM (not working yet)” -Fore Green
    Write-Host “`t`t`t3. Go to Main Menu`n” -Fore Green
    [int]$xMenu2 = Read-Host “`t`tEnter Menu Option Number”
    if( $xMenu1 -lt 1 -or $xMenu1 -gt 3 ){
    Write-Host “`tPlease select one of the options available.`n” -Fore Red;start-Sleep -Seconds 1
    Switch ($xMenu2){
    1 {
    CLS
    Write-Host “`t`tStarting PSHVM`n” -Fore Cyan
    call powershell -WindowStyle Hidden C:\PSHVM30\hyperv.ps1
    2 {
    CLS
    Write-Host “`t`tStarting Corefig (For now, later, ProHVM)`n” -Fore Cyan
    start C:\Corefig\COREFIG.PS1
    default { Write-Host “`n`tYou Selected Option 3 – Go to Main Menu`n” -Fore Yellow; break}
    default { $global:xExitSession=$true;break }
    LoadMenuSystem
    If ($xExitSession){
    Exit-PSSession #… User quit & Exit
    } Else {
    C:\Mgmt\MgmtSel.ps1 #… Loop the function

    How are you running the script on the server? Pasting into the ISE on the server, saving as a script and running it from the command line on the server? Or something else?
    When you say you paste it into the PowerShell window and it runs fine, is this PowerShell window on your machine or the server? How are you pasting it (RDP? Teamviewer? VNC?).
    It appears that some of the characters are not being saved/pasted correctly. You could try paste into notepad first and make sure all the characters are correct there, then select all and paste into the window on the server, or use noteapad to save the document
    as a regular text file before copying to the server.

  • Safari Vulnerability - Test for script running

    Hi everyone,
    Just wondering if anyone out there knows how to test if someone has a script running on your computer, in relation to the vulnerability from safari.
    The last few days I have not been able to load the Apple.com/au website or log into "My eBay" page. It seems as though someone is blocking it. It gets to a certain stage and will just not load anymore. Other sites load just fine.
    I upgraded to 10.4.5 and was able to load these pages for a brief period of time and then it reverted to not being able to load again.
    Is someone controlling my computer and can they get access to sensitive info??
    Cheers.
    iMac 20" G5   Mac OS X (10.4.5)  

    Thanks for the suggestion, however I am using alternate credentials when using Add-Computer. I had taken that out of the script as shown, as I've been simplifying the code down to isolate my issue. That probably wasn't clear from my initial post.
    Just to clarify, The script itself runs as Local System since it's getting launched by the local computer GPO. Even with providing alternate credentials to the Add-Computer cmdlet, the script doesn't execute the command correctly and the script never actually
    completes. I know that it is stuck at the Add-Computer cmdlet as I had put some debugging logging to a text file, and that's the last message that appears in the text file.
    In the simplifiction of my code, I was attempting to use Invoke-Command in a different user context to execute the Add-Computer cmdlet. Again, the Add-Computer was removed to simplify for debugging, but I have again run into the same issue where the script
    running as Local System now hangs at the following line of the script:
    $localSession = New-PSSession -Credential $LocalCred
    Again, I'm able to confirm that from the logging I've put in, and that's the last message that's written
    to the logfile, and I can see the process still running in Task Manager and I end up having to terminate.
    Hopefully that makes some sense and someone has come across this issue.

Maybe you are looking for

  • How to get notification of new post  for any discussion topic

    hi, i ve started a discussion in portal and i want to get notification for any new post to that discussion topic in my uwl....can anybody help me thanks in advance Message was edited by: Amit Pandey

  • SAP QUERY copied to z program.

    Hi , There was an standard sap query ,system had generated a program for this ,this program is copied to a Zprogram and some modificationa had been done for the zprogram in_sap4.7_ version.Now they want this z program to be copied to ECC6.0.Here my q

  • Open NAT Type help ( CISCO WRV210 )

    Hello, can anyone help me open my NAT Type? it says my NAT Types : 2 and that it is Moderate,i really really really want to open it , I Tried going to the Small Business webpage and I Couldn't find anything that's why I came back here, could anynone

  • Why can't I download iMovie and iPhoto?

    Hello, After upgrading to Yosemite I found that Internet connection was slow, and dodgy, so I took it to the Apple Store and re-installed Mavericks Internet worked fine, it was fast again, etc. I tried to open iMovie and iPhoto Not there I checked in

  • Client for Oracle OLAP

    Hi! I'm new to Oracle OLAP. What end-user client software can I use to analyze my data?